<s> from UcsSdk import * <EOL> handle1_ip = '<STR_LIT>' <EOL> handle1_user = '<STR_LIT:username>' <EOL> handle1_password = '<STR_LIT:password>' <EOL> handle2_ip = '<STR_LIT>' <EOL> handle2_user = '<STR_LIT:username>' <EOL> handle2_password = '<STR_LIT:password>' <EOL> try : <EOL> handle1 = UcsHandle ( ) <EOL> handle1 . Login ( handle1_ip , handle1_user , handle1_password ) <EOL> handle2 = UcsHandle ( ) <EOL> handle2 . Login ( handle2_ip , handle2_user , handle2_password ) <EOL> moList1 = handle1 . GetManagedObject ( None , OrgOrg . ClassId ( ) , { OrgOrg . DN : "<STR_LIT>" } , YesOrNo . TRUE ) <EOL> moList2 = handle2 . GetManagedObject ( None , OrgOrg . ClassId ( ) , { OrgOrg . DN : "<STR_LIT>" } , YesOrNo . TRUE ) <EOL> modiff = CompareManagedObject ( referenceObject = moList1 , differenceObject = moList2 ) <EOL> print "<STR_LIT>" <EOL> WriteObject ( modiff ) <EOL> handle1 . SyncManagedObject ( difference = modiff1 , deleteNotPresent = True , dumpXml = False ) <EOL> handle1 . Logout ( ) <EOL> handle2 . Logout ( ) <EOL> except Exception , err : <EOL> handle1 . Logout ( ) <EOL> handle2 . Logout ( ) <EOL> print "<STR_LIT>" , str ( err ) <EOL> import traceback , sys <EOL> print '<STR_LIT:->' * <NUM_LIT> <EOL> traceback . print_exc ( file = sys . stdout ) <EOL> print '<STR_LIT:->' * <NUM_LIT> </s>
