Rename driver 'activate' method to 'create'.

This will change the driver API to be more in-line with the
'hpcs_action' states.
This commit is contained in:
David Shrewsbury
2012-10-08 16:42:23 -04:00
parent 2f9d2c847c
commit 754af827f9
3 changed files with 5 additions and 5 deletions

View File

@@ -89,10 +89,10 @@ class LBaaSController(object):
lb_node['condition'] = self.NODE_OK
try:
self.driver.activate()
self.driver.create()
except NotImplementedError:
self.logger.error(
"Selected driver does not support activating changes."
"Selected driver does not support CREATE action."
)
for lb_node in self.msg['nodes']:
lb_node['condition'] = self.NODE_ERR

View File

@@ -38,8 +38,8 @@ class LoadBalancerDriver(object):
""" Add a server for which we will proxy. """
raise NotImplementedError()
def activate(self):
""" Activate any changes made. """
def create(self):
""" Create the load balancer. """
raise NotImplementedError()
def suspend(self):

View File

@@ -116,6 +116,6 @@ class HAProxyDriver(LoadBalancerDriver):
self._config['servers'] = []
self._config['servers'].append((host, port))
def activate(self):
def create(self):
self._write_config()
self._restart()