Lines Matching defs:afe
55 def add_powerunit_info_to_host(afe, device, keyvals):
56 """Add keyvals to the host's attributes in AFE.
58 @param afe: AFE server to talk to.
62 are going to insert to AFE as host attributes.
64 if not afe.get_hosts(hostname=device):
70 afe.set_host_attribute(key, val, hostname=device)
73 def add_from_csv(afe, csv_file):
76 @param afe: AFE server to talk to.
91 add_powerunit_info_to_host(afe, device, keyvals)
94 def dump_to_csv(afe, csv_file):
97 @param afe: AFE server to talk to.
103 hosts = afe.get_hosts()
112 def list_powerunit_info(afe, devices):
115 @param afe: AFE server to talk to.
118 hosts = afe.get_hosts(hostname__in = devices)
149 help='AFE server that the script will be talking to. '
173 afe = frontend_wrappers.RetryingAFE(timeout_min=5, delay_sec=10,
175 logging.info('Connected to %s', afe.server)
177 dump_to_csv(afe, options.csv_file)
183 add_from_csv(afe, options.csv_file)
185 list_powerunit_info(afe, [h.strip() for h in options.hostnames.split(',')])