Rename _push functions into set (for coherency with get)
This commit is contained in:
parent
12b04cf251
commit
e1d6e5afd3
@ -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()))
|
||||
|
@ -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":
|
||||
|
Loading…
Reference in New Issue
Block a user