Rename _push functions into set (for coherency with get)

This commit is contained in:
Bruno Cornec 2015-12-23 12:08:44 +01:00
parent 12b04cf251
commit e1d6e5afd3
2 changed files with 7 additions and 5 deletions

View File

@ -94,7 +94,7 @@ def synchronize_ci(ci):
# Push the data provided above to all our drivers
for driver in config.alexandria.drivers:
app.logger.info("Push information to {} driver.".format(driver.get_driver_type()))
driver.push_ci(ci)
driver.set_ci(ci)
@app.route('/ci', methods=['PUT'])
@ -162,4 +162,3 @@ if __name__ == "__main__":
#pp.pprint(models.Manager) # debugging example.
app.logger.info("Starting %s...", config.alexandria.NAME)
app.run(port=int(config.alexandria.conf_file.get_alexandria_port()))

View File

@ -20,7 +20,7 @@ class Driver(object):
def get_ci(self, ci):
pass
def push_ci(self, ci):
def set_ci(self, ci):
pass
@ -30,7 +30,7 @@ class Itop(Driver):
print("Get from itop")
return True
def push_ci(self, ci):
def set_ci(self, ci):
username = config.alexandria.conf_file.get_driver_parameters("itop", "loginItop")
password = config.alexandria.conf_file.get_driver_parameters("itop", "passwordItop")
config.logger.debug("login : {}, password : {}".format(
@ -87,6 +87,9 @@ class Redfish(Driver):
#print("Redfish API version : {} \n".format(remote_mgmt.get_api_version()))
return True
def set_ci(self, ci):
print "Push to Redfish"
return True
class Ironic(Driver):
pass
@ -97,7 +100,7 @@ class Mondorescue(Driver):
class Fakecmdb(Driver):
def push_ci(self, ci):
def set_ci(self, ci):
# Determine ci type so we can do the proper action.
pp = pprint.PrettyPrinter(indent=4)
if ci.ci_type == "Manager":