Make pool manager meet 1.2 API spec
Change-Id: I8383272a4d289f8c9979793d6014a2a1bf73d88e
This commit is contained in:
@@ -55,3 +55,4 @@ nodes = 10
|
|||||||
check_interval = 5
|
check_interval = 5
|
||||||
failed_interval = 15
|
failed_interval = 15
|
||||||
node_basename = 'libra'
|
node_basename = 'libra'
|
||||||
|
az = 1
|
||||||
|
@@ -19,7 +19,7 @@ import sys
|
|||||||
|
|
||||||
from libra.mgm.drivers.base import MgmDriver
|
from libra.mgm.drivers.base import MgmDriver
|
||||||
|
|
||||||
API_VERSION = 'v1'
|
API_VERSION = 'v1.2'
|
||||||
|
|
||||||
|
|
||||||
class HPRestDriver(MgmDriver):
|
class HPRestDriver(MgmDriver):
|
||||||
|
@@ -212,7 +212,12 @@ class Server(object):
|
|||||||
for address in addresses:
|
for address in addresses:
|
||||||
if not address['addr'].startswith('10.'):
|
if not address['addr'].startswith('10.'):
|
||||||
break
|
break
|
||||||
body['address'] = address['addr']
|
body['publicIpAddr'] = address['addr']
|
||||||
|
body['floatingIpAddr'] = address['addr']
|
||||||
|
body['az'] = self.args.az
|
||||||
|
body['type'] = "basename: {0}, image: {1}".format(
|
||||||
|
self.args.node_basename, self.args.nova_image
|
||||||
|
)
|
||||||
return body
|
return body
|
||||||
|
|
||||||
def find_unknown(self, name, nova):
|
def find_unknown(self, name, nova):
|
||||||
@@ -270,8 +275,9 @@ class Server(object):
|
|||||||
self.logger.warning('Aborting node building')
|
self.logger.warning('Aborting node building')
|
||||||
return
|
return
|
||||||
body = self.build_node_data(data)
|
body = self.build_node_data(data)
|
||||||
self.logger.info('Adding node {name} on {ip}'
|
self.logger.info('Adding node {name} on {ip}'.format(
|
||||||
.format(name=body['name'], ip=body['address']))
|
name=body['name'], ip=body['publicIpAddr'])
|
||||||
|
)
|
||||||
status, response = api.add_node(body)
|
status, response = api.add_node(body)
|
||||||
if not status:
|
if not status:
|
||||||
self.logger.error(
|
self.logger.error(
|
||||||
@@ -313,6 +319,11 @@ def main():
|
|||||||
'--datadir', dest='datadir',
|
'--datadir', dest='datadir',
|
||||||
help='directory to store data files'
|
help='directory to store data files'
|
||||||
)
|
)
|
||||||
|
options.parser.add_argument(
|
||||||
|
'--az', type=int,
|
||||||
|
help='The az number the node will reside in (to be passed to the API'
|
||||||
|
' server)'
|
||||||
|
)
|
||||||
options.parser.add_argument(
|
options.parser.add_argument(
|
||||||
'--nodes', type=int, default=1,
|
'--nodes', type=int, default=1,
|
||||||
help='number of nodes'
|
help='number of nodes'
|
||||||
@@ -377,7 +388,7 @@ def main():
|
|||||||
args = options.run()
|
args = options.run()
|
||||||
|
|
||||||
required_args = [
|
required_args = [
|
||||||
'datadir',
|
'datadir', 'az',
|
||||||
'nova_image', 'nova_image_size', 'nova_secgroup', 'nova_keyname',
|
'nova_image', 'nova_image_size', 'nova_secgroup', 'nova_keyname',
|
||||||
'nova_tenant', 'nova_region', 'nova_user', 'nova_pass', 'nova_auth_url'
|
'nova_tenant', 'nova_region', 'nova_user', 'nova_pass', 'nova_auth_url'
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user