fixed up tests after trunk merge and bumped version
This commit is contained in:
parent
3e9a548949
commit
46855896a8
|
@ -47,7 +47,7 @@ copyright = u'Rackspace, based on work by Jacob Kaplan-Moss'
|
||||||
# The short X.Y version.
|
# The short X.Y version.
|
||||||
version = '2.5'
|
version = '2.5'
|
||||||
# The full version, including alpha/beta/rc tags.
|
# The full version, including alpha/beta/rc tags.
|
||||||
release = '2.5.4'
|
release = '2.5.5'
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
|
|
@ -227,11 +227,8 @@ class OpenStackShell(object):
|
||||||
server = self._find_server(args.server)
|
server = self._find_server(args.server)
|
||||||
server.backup_schedule.delete()
|
server.backup_schedule.delete()
|
||||||
|
|
||||||
def _boot(self, args, reservation_id=None):
|
def _boot(self, args, reservation_id=None, min_count=1, max_count=1):
|
||||||
"""Boot a new server."""
|
"""Boot a new server."""
|
||||||
min_count = args.min_instances
|
|
||||||
max_count = args.max_instances or min_count
|
|
||||||
|
|
||||||
if max_count > min_count:
|
if max_count > min_count:
|
||||||
raise CommandError("min_instances should be <= max_instances")
|
raise CommandError("min_instances should be <= max_instances")
|
||||||
if not min_count or not max_count:
|
if not min_count or not max_count:
|
||||||
|
@ -319,8 +316,8 @@ class OpenStackShell(object):
|
||||||
@arg('name', metavar='<name>', help='Name for the new server')
|
@arg('name', metavar='<name>', help='Name for the new server')
|
||||||
def do_boot(self, args):
|
def do_boot(self, args):
|
||||||
"""Boot a new server."""
|
"""Boot a new server."""
|
||||||
name, image, flavor, ipgroup, metadata, files, reservation_id = \
|
name, image, flavor, ipgroup, metadata, files, reservation_id, \
|
||||||
self._boot(args)
|
min_count, max_count = self._boot(args)
|
||||||
|
|
||||||
server = self.cs.servers.create(args.name, image, flavor,
|
server = self.cs.servers.create(args.name, image, flavor,
|
||||||
ipgroup=ipgroup,
|
ipgroup=ipgroup,
|
||||||
|
@ -369,8 +366,8 @@ class OpenStackShell(object):
|
||||||
@arg('name', metavar='<name>', help='Name for the new server')
|
@arg('name', metavar='<name>', help='Name for the new server')
|
||||||
def do_boot_for_account(self, args):
|
def do_boot_for_account(self, args):
|
||||||
"""Boot a new server in an account."""
|
"""Boot a new server in an account."""
|
||||||
name, image, flavor, ipgroup, metadata, files, reservation_id = \
|
name, image, flavor, ipgroup, metadata, files, reservation_id, \
|
||||||
self._boot(args)
|
min_count, max_count = self._boot(args)
|
||||||
|
|
||||||
server = self.cs.accounts.create_instance_for(args.account, args.name,
|
server = self.cs.accounts.create_instance_for(args.account, args.name,
|
||||||
image, flavor,
|
image, flavor,
|
||||||
|
@ -432,10 +429,14 @@ class OpenStackShell(object):
|
||||||
def do_zone_boot(self, args):
|
def do_zone_boot(self, args):
|
||||||
"""Boot a new server, potentially across Zones."""
|
"""Boot a new server, potentially across Zones."""
|
||||||
reservation_id = args.reservation_id
|
reservation_id = args.reservation_id
|
||||||
|
min_count = args.min_instances
|
||||||
|
max_count = args.max_instances
|
||||||
name, image, flavor, ipgroup, metadata, \
|
name, image, flavor, ipgroup, metadata, \
|
||||||
files, reservation_id, min_count, max_count = \
|
files, reservation_id, min_count, max_count = \
|
||||||
self._boot(args,
|
self._boot(args,
|
||||||
reservation_id=reservation_id)
|
reservation_id=reservation_id,
|
||||||
|
min_count=min_count,
|
||||||
|
max_count=max_count)
|
||||||
|
|
||||||
reservation_id = self.cs.zones.boot(args.name, image, flavor,
|
reservation_id = self.cs.zones.boot(args.name, image, flavor,
|
||||||
ipgroup=ipgroup,
|
ipgroup=ipgroup,
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -11,7 +11,7 @@ if sys.version_info < (2,6):
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name = "python-novaclient",
|
name = "python-novaclient",
|
||||||
version = "2.5.4",
|
version = "2.5.5",
|
||||||
description = "Client library for OpenStack Nova API",
|
description = "Client library for OpenStack Nova API",
|
||||||
long_description = read('README.rst'),
|
long_description = read('README.rst'),
|
||||||
url = 'https://github.com/rackspace/python-novaclient',
|
url = 'https://github.com/rackspace/python-novaclient',
|
||||||
|
|
|
@ -69,14 +69,16 @@ def test_boot():
|
||||||
shell('boot --image 1 some-server')
|
shell('boot --image 1 some-server')
|
||||||
assert_called(
|
assert_called(
|
||||||
'POST', '/servers',
|
'POST', '/servers',
|
||||||
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1'}}
|
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
||||||
|
'min_count': 1, 'max_count': 1}}
|
||||||
)
|
)
|
||||||
|
|
||||||
shell('boot --image 1 --meta foo=bar --meta spam=eggs some-server ')
|
shell('boot --image 1 --meta foo=bar --meta spam=eggs some-server ')
|
||||||
assert_called(
|
assert_called(
|
||||||
'POST', '/servers',
|
'POST', '/servers',
|
||||||
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
||||||
'metadata': {'foo': 'bar', 'spam': 'eggs'}}}
|
'min_count': 1, 'max_count': 1,
|
||||||
|
'metadata': {'foo': 'bar', 'spam': 'eggs'}}}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,6 +92,7 @@ def test_boot_files():
|
||||||
assert_called(
|
assert_called(
|
||||||
'POST', '/servers',
|
'POST', '/servers',
|
||||||
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
||||||
|
'min_count': 1, 'max_count': 1,
|
||||||
'personality': [
|
'personality': [
|
||||||
{'path': '/tmp/bar', 'contents': expected_file_data},
|
{'path': '/tmp/bar', 'contents': expected_file_data},
|
||||||
{'path': '/tmp/foo', 'contents': expected_file_data}
|
{'path': '/tmp/foo', 'contents': expected_file_data}
|
||||||
|
@ -117,6 +120,7 @@ def test_boot_key_auto():
|
||||||
assert_called(
|
assert_called(
|
||||||
'POST', '/servers',
|
'POST', '/servers',
|
||||||
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
||||||
|
'min_count': 1, 'max_count': 1,
|
||||||
'personality': [{
|
'personality': [{
|
||||||
'path': '/root/.ssh/authorized_keys2',
|
'path': '/root/.ssh/authorized_keys2',
|
||||||
'contents': ('SSHKEY').encode('base64')},
|
'contents': ('SSHKEY').encode('base64')},
|
||||||
|
@ -144,6 +148,7 @@ def test_boot_key_file():
|
||||||
assert_called(
|
assert_called(
|
||||||
'POST', '/servers',
|
'POST', '/servers',
|
||||||
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
||||||
|
'min_count': 1, 'max_count': 1,
|
||||||
'personality': [
|
'personality': [
|
||||||
{'path': '/root/.ssh/authorized_keys2', 'contents':
|
{'path': '/root/.ssh/authorized_keys2', 'contents':
|
||||||
expected_file_data},
|
expected_file_data},
|
||||||
|
@ -163,7 +168,7 @@ def test_boot_ipgroup():
|
||||||
assert_called(
|
assert_called(
|
||||||
'POST', '/servers',
|
'POST', '/servers',
|
||||||
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
||||||
'sharedIpGroupId': 1}}
|
'sharedIpGroupId': 1, 'min_count': 1, 'max_count': 1}}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -172,7 +177,7 @@ def test_boot_ipgroup_name():
|
||||||
assert_called(
|
assert_called(
|
||||||
'POST', '/servers',
|
'POST', '/servers',
|
||||||
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
{'server': {'flavorId': 1, 'name': 'some-server', 'imageId': '1',
|
||||||
'sharedIpGroupId': 1}}
|
'sharedIpGroupId': 1, 'min_count': 1, 'max_count': 1}}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue