Mailing List CGatePro@mail.stalker.com Message #92378
From: Robinson Maureira Castillo <rmaureira@solint.cl>
Subject: Re: Deleting several accounts using perl program
Date: Wed, 29 Aug 2007 12:34:41 -0400
To: CommuniGate Pro Discussions <CGatePro@mail.stalker.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If you want to force the deletion of the accounts, you can use the
KillAccountSessions CLI command, to disconnect those accounts before
trying to delete them.

Best regards,

Jeff Wark wrote:
> Your problem may be here:
>
> *snip*
>                 $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";
> *snip*
>
> If you try to delete an account and it is currently active or logged
> into, it will not work, and your program will still print out "$_ has
> been successfully deleted \n" to the handle FICSTAT [not sure what that
> is].
>
> I don't see any of the "Alerte Interface MListes:..." messages in your
> output, but if you are providing the output from the FICSTAT handle,
> perhaps you are missing some failures that are printed to STDOUT.
>
> On Wed, 29 Aug 2007 16:58:12 +0200
>  Germain MAURICE <maurice@essec.fr> wrote:
>>> 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
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>>  the mailing list <CGatePro@mail.stalker.com>.
>>> To unsubscribe, E-mail to: <CGatePro-off@mail.stalker.com>
>>> To switch to the DIGEST mode, E-mail to
>>> <CGatePro-digest@mail.stalker.com>
>>> To switch to the INDEX mode, E-mail to <CGatePro-index@mail.stalker.com>
>>> Send administrative queries to  <CGatePro-request@mail.stalker.com>
>
> Jeff Wark
> TBayTel Internet
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list <CGatePro@mail.stalker.com>.
> To unsubscribe, E-mail to: <CGatePro-off@mail.stalker.com>
> To switch to the DIGEST mode, E-mail to <CGatePro-digest@mail.stalker.com>
> To switch to the INDEX mode, E-mail to <CGatePro-index@mail.stalker.com>
> Send administrative queries to  <CGatePro-request@mail.stalker.com>

- --
Robinson Maureira Castillo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFG1aAgu+2kmA0sEb4RAnIfAJ9wurnD/r4naETsM3+e+PGiouRWxACfesP7
xubByM96AvEcChWBPvvZbgI=
=cCuD
-----END PGP SIGNATURE-----
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster