from emcli import * search_list = ['PROPERTY_NAME=\'DBVersion\'','TARGET_TYPE=\'oracle_database\'','PROPERTY_VALUE LIKE \'11.2%\''] if len(sys.argv) == 2: print login(username=sys.argv[0]) l_prop_val_to_set = sys.argv[1] l_targets = list(resource="TargetProperties", search=search_list, columns="TARGET_NAME,TARGET_TYPE,PROPERTY_NAME") for target in l_targets.out()['data']: t_pn = 'LifeCycle Status' print "INFO: Setting Property name " + t_pn + " to value " + l_prop_val_to_set print set_target_property_value(property_records=target['TARGET_NAME']+":"+target['TARGET_TYPE']+":"+t_pn+":"+l_prop_val_to_set) else: print "\n ERROR: Property value argument is missing" print "\n INFO: Format to run this file is filename.py "