Mailing List CGatePro@mail.stalker.com Message #92375
From: Germain MAURICE <maurice@essec.fr>
Subject: Deleting several accounts using perl program
Date: Wed, 29 Aug 2007 16:58:12 +0200
To: <support@stalker.com>
X-Mailer: Sylpheed 2.4.4 (GTK+ 2.10.13; i686-pc-mingw32)
Hello,

I have a problem with using Communigate v5.1.9, CGP Perl CLI module version 2.7.1.
My platform is a RHEL r3.

The accounts seem to be not entirely deleted in the same session, if I launch the program several times, at the end of the differents execution, the job is done. It's very weird. Do you have any idea of the source of this problem ?

I really hope you can help me to fix it.

Regards,
Germain

So, my perl program named importlist.pl contains these parts of code :
###############################################
use CGP::CLI;
$Deleted_Success = 0;
$d=0;
$i=0;
for ($i = 0; $i < 4; $i++ ){
        &list_accounts_and_delete_lists ;
        # Defini Deleted_Success = 1 systematiquement
        $Deleted_Success = 1;
        $d=1;
        system("sleep 5");
        print "Deleted_Success = $d $Deleted_Success\n";
        $d = &testing_deleted_accounts;
        print "Deleted_Success = $d $Deleted_Success\n";
        # Defini Deleted_Success = 0 si au moins un "mlo-" existe encore
        printf FICSTAT ">global DS = $d $Deleted_Success\n";
}
printf FICSTAT "global DS = $d $Deleted_Success\n";
&create_accounts_and_lists ;

sub open_cli         #  Connexion au CLI de CGPRO
{

 $cli = new CGP::CLI( { PeerAddr => $CGServerAddress,
                          PeerPort => 106,
                          login    => $Login,
                          password => $Password } )
   || die "Can't login to CGPro: ".$CGP::ERR_STRING."\n";
}

sub testing_deleted_accounts{
        &open_cli;
        printf FICSTAT "Module: list_accounts STARTED \n";
        $AccountList = [];
        $AccountList = $cli->ListAccounts($domain)
                || die "Alerte Interface MListes:Error:(1) ".$cli->getErrMessage.", quitting";
        foreach(keys %$AccountList)
                {
                        if ($_ =~ /mlo-/)
                                {
                                        printf FICSTAT "$_ tested ";
                                        $Deleted_Success = 1;
                                        $d=1;
                                        printf FICSTAT "DS = $Deleted_Success\n";
                                }
                }
        $cli->Logout;
        printf FICSTAT "Module: list_accounts ENDED \n\n";
        return $d;
}

sub list_accounts_and_delete_lists
 {
   &open_cli;
    printf FICSTAT "Module: list_accounts_and_delete_lists STARTED \n";

  $AccountList = $cli->ListAccounts($domain)
         || die "Alerte Interface MListes:Error:(1) ".$cli->getErrMessage.", quitting";
  foreach(keys %$AccountList)
          {
          print "$_\n";
          if ($_ =~ /mlo-/)
               {
                $cli->DeleteAccount($_)
                        || print "Alerte Interface MListes:Error(Delete $_): $cli->getErrMessage , quitting\n";
          printf FICSTAT "$_ has been successfully deleted \n";
          print "$_ has been successfully deleted \n";

               }
          }
 $cli->Logout;
 printf FICSTAT "Module: list_accounts_and_delete_lists ENDED \n\n";
 }

sub create_accounts_and_lists {
&open_cli;
printf FICSTAT "Module: create_accounts_and_lists STARTED \n";
# The content of this procedure is not useless for this case
$cli->Logout;
printf FICSTAT "Module: create_accounts_and_lists ENDED \n\n";
}


####################################

These previous parts of my program made this result during its execution :


Module: list_accounts_and_delete_lists STARTED
mlo-ex0000ap has been successfully deleted
mlo-pgemba02 has been successfully deleted
mlo-pgemba12 has been successfully deleted
mlo-pgmgai01 has been successfully deleted
mlo-pgemba22 has been successfully deleted
mlo-pgimhil2 has been successfully deleted
mlo-pgmsia01 has been successfully deleted
mlo-ep000002 has been successfully deleted
mlo-2pmsaifc has been successfully deleted
mlo-3mxmbafc has been successfully deleted
mlo-isisfoap has been successfully deleted
mlo-pgmlms01 has been successfully deleted
mlo-pgmsir01 has been successfully deleted
mlo-pgmmue01 has been successfully deleted
mlo-ep000004 has been successfully deleted
mlo-ec0000eu has been successfully deleted
mlo-pgmdai01 has been successfully deleted
mlo-pgmsia02 has been successfully deleted
mlo-pgmmkg01 has been successfully deleted
mlo-pgimhil1 has been successfully deleted
mlo-dosreins has been successfully deleted
mlo-pgemba11 has been successfully deleted
mlo-pgmtfi01 has been successfully deleted
mlo-pgimhis1 has been successfully deleted
mlo-pgmmkg02 has been successfully deleted
mlo-pgluxe01 has been successfully deleted
mlo-pi000001 has been successfully deleted
mlo-pgimhieu has been successfully deleted
mlo-ep000001 has been successfully deleted
mlo-pgmmia01 has been successfully deleted
mlo-pgmasf01 has been successfully deleted
mlo-pgmsir02 has been successfully deleted
mlo-ep000003 has been successfully deleted
mlo-dpphmk01 has been successfully deleted
mlo-pgmmpt01 has been successfully deleted
mlo-dpphma01 has been successfully deleted
mlo-dpphdm01 has been successfully deleted
mlo-dpphec01 has been successfully deleted
mlo-pgemba01 has been successfully deleted
mlo-pgemba21 has been successfully deleted
mlo-ep000005 has been successfully deleted
mlo-pgemba03 has been successfully deleted
Module: list_accounts_and_delete_lists ENDED

Module: list_accounts STARTED
mlo-ex0000ap tested DS = 1
mlo-pgemba02 tested DS = 1
mlo-pgemba12 tested DS = 1
mlo-pgmgai01 tested DS = 1
mlo-pgemba22 tested DS = 1
mlo-pgimhil2 tested DS = 1
mlo-pgmsia01 tested DS = 1
mlo-isisfoap tested DS = 1
mlo-pgmlms01 tested DS = 1
mlo-pgmsir01 tested DS = 1
mlo-pgmmue01 tested DS = 1
mlo-ep000004 tested DS = 1
mlo-pgmdai01 tested DS = 1
mlo-pgmsia02 tested DS = 1
mlo-pgmmkg01 tested DS = 1
mlo-pgimhil1 tested DS = 1
mlo-dosreins tested DS = 1
mlo-pgemba11 tested DS = 1
mlo-pgmtfi01 tested DS = 1
mlo-pgimhis1 tested DS = 1
mlo-pgmmkg02 tested DS = 1
mlo-pgluxe01 tested DS = 1
mlo-pi000001 tested DS = 1
mlo-pgimhieu tested DS = 1
mlo-pgmmia01 tested DS = 1
mlo-pgmasf01 tested DS = 1
mlo-pgmsir02 tested DS = 1
mlo-ep000003 tested DS = 1
mlo-pgmmpt01 tested DS = 1
mlo-pgemba01 tested DS = 1
mlo-pgemba21 tested DS = 1
mlo-ep000005 tested DS = 1
mlo-pgemba03 tested DS = 1
Module: list_accounts ENDED

>global DS = 1 1
Module: list_accounts_and_delete_lists STARTED
mlo-ex0000ap has been successfully deleted
mlo-pgemba02 has been successfully deleted
mlo-pgemba12 has been successfully deleted
mlo-pgmgai01 has been successfully deleted
mlo-pgemba22 has been successfully deleted
mlo-pgimhil2 has been successfully deleted
mlo-pgmsia01 has been successfully deleted
mlo-isisfoap has been successfully deleted
mlo-pgmlms01 has been successfully deleted
mlo-pgmsir01 has been successfully deleted
mlo-pgmmue01 has been successfully deleted
mlo-ep000004 has been successfully deleted
mlo-pgmdai01 has been successfully deleted
mlo-pgmsia02 has been successfully deleted
mlo-pgmmkg01 has been successfully deleted
mlo-pgimhil1 has been successfully deleted
mlo-dosreins has been successfully deleted
mlo-pgemba11 has been successfully deleted
mlo-pgmtfi01 has been successfully deleted
mlo-pgimhis1 has been successfully deleted
mlo-pgmmkg02 has been successfully deleted
mlo-pgluxe01 has been successfully deleted
mlo-pi000001 has been successfully deleted
mlo-pgimhieu has been successfully deleted
mlo-pgmmia01 has been successfully deleted
mlo-pgmasf01 has been successfully deleted
mlo-pgmsir02 has been successfully deleted
mlo-ep000003 has been successfully deleted
mlo-pgmmpt01 has been successfully deleted
mlo-pgemba01 has been successfully deleted
mlo-pgemba21 has been successfully deleted
mlo-ep000005 has been successfully deleted
mlo-pgemba03 has been successfully deleted
Module: list_accounts_and_delete_lists ENDED

Module: list_accounts STARTED
mlo-ex0000ap tested DS = 1
mlo-pgemba02 tested DS = 1
mlo-pgemba12 tested DS = 1
mlo-pgmgai01 tested DS = 1
mlo-pgemba22 tested DS = 1
mlo-pgimhil2 tested DS = 1
mlo-pgmsia01 tested DS = 1
mlo-isisfoap tested DS = 1
mlo-pgmlms01 tested DS = 1
mlo-pgmsir01 tested DS = 1
mlo-pgmmue01 tested DS = 1
mlo-ep000004 tested DS = 1
mlo-pgmdai01 tested DS = 1
mlo-pgmsia02 tested DS = 1
mlo-pgmmkg01 tested DS = 1
mlo-pgimhil1 tested DS = 1
mlo-dosreins tested DS = 1
mlo-pgemba11 tested DS = 1
mlo-pgmtfi01 tested DS = 1
mlo-pgimhis1 tested DS = 1
mlo-pgmmkg02 tested DS = 1
mlo-pgluxe01 tested DS = 1
mlo-pi000001 tested DS = 1
mlo-pgimhieu tested DS = 1
mlo-pgmmia01 tested DS = 1
mlo-pgmasf01 tested DS = 1
mlo-pgmsir02 tested DS = 1
mlo-pgmmpt01 tested DS = 1
mlo-pgemba01 tested DS = 1
mlo-pgemba21 tested DS = 1
mlo-ep000005 tested DS = 1
mlo-pgemba03 tested DS = 1
Module: list_accounts ENDED

>global DS = 1 1
Module: list_accounts_and_delete_lists STARTED
mlo-ex0000ap has been successfully deleted
mlo-pgemba02 has been successfully deleted
mlo-pgemba12 has been successfully deleted
mlo-pgmgai01 has been successfully deleted
mlo-pgemba22 has been successfully deleted
mlo-pgimhil2 has been successfully deleted
mlo-pgmsia01 has been successfully deleted
mlo-isisfoap has been successfully deleted
mlo-pgmlms01 has been successfully deleted
mlo-pgmsir01 has been successfully deleted
mlo-pgmmue01 has been successfully deleted
mlo-ep000004 has been successfully deleted
mlo-pgmdai01 has been successfully deleted
mlo-pgmsia02 has been successfully deleted
mlo-pgmmkg01 has been successfully deleted
mlo-pgimhil1 has been successfully deleted
mlo-dosreins has been successfully deleted
mlo-pgemba11 has been successfully deleted
mlo-pgmtfi01 has been successfully deleted
mlo-pgimhis1 has been successfully deleted
mlo-pgmmkg02 has been successfully deleted
mlo-pgluxe01 has been successfully deleted
mlo-pi000001 has been successfully deleted
mlo-pgimhieu has been successfully deleted
mlo-pgmmia01 has been successfully deleted
mlo-pgmasf01 has been successfully deleted
mlo-pgmsir02 has been successfully deleted
mlo-pgmmpt01 has been successfully deleted
mlo-pgemba01 has been successfully deleted
mlo-pgemba21 has been successfully deleted
mlo-ep000005 has been successfully deleted
mlo-pgemba03 has been successfully deleted
Module: list_accounts_and_delete_lists ENDED

Module: list_accounts STARTED
mlo-ex0000ap tested DS = 1
mlo-pgemba02 tested DS = 1
mlo-pgemba12 tested DS = 1
mlo-pgmgai01 tested DS = 1
mlo-pgemba22 tested DS = 1
mlo-pgimhil2 tested DS = 1
mlo-pgmsia01 tested DS = 1
mlo-isisfoap tested DS = 1
mlo-pgmlms01 tested DS = 1
mlo-pgmsir01 tested DS = 1
mlo-pgmmue01 tested DS = 1
mlo-ep000004 tested DS = 1
mlo-pgmdai01 tested DS = 1
mlo-pgmsia02 tested DS = 1
mlo-pgmmkg01 tested DS = 1
mlo-pgimhil1 tested DS = 1
mlo-dosreins tested DS = 1
mlo-pgemba11 tested DS = 1
mlo-pgmtfi01 tested DS = 1
mlo-pgimhis1 tested DS = 1
mlo-pgmmkg02 tested DS = 1
mlo-pgluxe01 tested DS = 1
mlo-pi000001 tested DS = 1
mlo-pgimhieu tested DS = 1
mlo-pgmmia01 tested DS = 1
mlo-pgmasf01 tested DS = 1
mlo-pgmsir02 tested DS = 1
mlo-pgmmpt01 tested DS = 1
mlo-pgemba01 tested DS = 1
mlo-pgemba21 tested DS = 1
mlo-ep000005 tested DS = 1
mlo-pgemba03 tested DS = 1
Module: list_accounts ENDED

>global DS = 1 1
Module: list_accounts_and_delete_lists STARTED
mlo-ex0000ap has been successfully deleted
mlo-pgemba02 has been successfully deleted
mlo-pgemba12 has been successfully deleted
mlo-pgmgai01 has been successfully deleted
mlo-pgemba22 has been successfully deleted
mlo-pgimhil2 has been successfully deleted
mlo-pgmsia01 has been successfully deleted
mlo-isisfoap has been successfully deleted
mlo-pgmlms01 has been successfully deleted
mlo-pgmsir01 has been successfully deleted
mlo-pgmmue01 has been successfully deleted
mlo-ep000004 has been successfully deleted
mlo-pgmdai01 has been successfully deleted
mlo-pgmsia02 has been successfully deleted
mlo-pgmmkg01 has been successfully deleted
mlo-pgimhil1 has been successfully deleted
mlo-dosreins has been successfully deleted
mlo-pgemba11 has been successfully deleted
mlo-pgmtfi01 has been successfully deleted
mlo-pgimhis1 has been successfully deleted
mlo-pgmmkg02 has been successfully deleted
mlo-pgluxe01 has been successfully deleted
mlo-pi000001 has been successfully deleted
mlo-pgimhieu has been successfully deleted
mlo-pgmmia01 has been successfully deleted
mlo-pgmasf01 has been successfully deleted
mlo-pgmsir02 has been successfully deleted
mlo-pgmmpt01 has been successfully deleted
mlo-pgemba01 has been successfully deleted
mlo-pgemba21 has been successfully deleted
mlo-ep000005 has been successfully deleted
mlo-pgemba03 has been successfully deleted
Module: list_accounts_and_delete_lists ENDED

Module: list_accounts STARTED
mlo-ex0000ap tested DS = 1
mlo-pgemba02 tested DS = 1
mlo-pgemba12 tested DS = 1
mlo-pgmgai01 tested DS = 1
mlo-pgemba22 tested DS = 1
mlo-pgimhil2 tested DS = 1
mlo-pgmsia01 tested DS = 1
mlo-isisfoap tested DS = 1
mlo-pgmlms01 tested DS = 1
mlo-pgmsir01 tested DS = 1
mlo-pgmmue01 tested DS = 1
mlo-ep000004 tested DS = 1
mlo-pgmdai01 tested DS = 1
mlo-pgmsia02 tested DS = 1
mlo-pgmmkg01 tested DS = 1
mlo-pgimhil1 tested DS = 1
mlo-dosreins tested DS = 1
mlo-pgemba11 tested DS = 1
mlo-pgmtfi01 tested DS = 1
mlo-pgimhis1 tested DS = 1
mlo-pgmmkg02 tested DS = 1
mlo-pgluxe01 tested DS = 1
mlo-pi000001 tested DS = 1
mlo-pgimhieu tested DS = 1
mlo-pgmmia01 tested DS = 1
mlo-pgmasf01 tested DS = 1
mlo-pgmsir02 tested DS = 1
mlo-pgmmpt01 tested DS = 1
mlo-pgemba01 tested DS = 1
mlo-pgemba21 tested DS = 1
mlo-ep000005 tested DS = 1
mlo-pgemba03 tested DS = 1
Module: list_accounts ENDED

>global DS = 1 1
global DS = 1 1
Module: create_accounts_and_lists STARTED
--
Germain MAURICE
TÚl : +33 1 34 43 28 32
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster