Jira-Issue:OPENSTACK-545

fix order of hosts in json inventory generator

- new filtering was reordering hosts in groups. change
will preserve the order in the inventory.

- also small update to destroy test to use --includedata
to avoid test failure.
This commit is contained in:
Steve Noyes 2015-12-11 09:35:26 -05:00
parent 8f6dd908b3
commit 6225da73c6
2 changed files with 4 additions and 4 deletions

View File

@ -757,8 +757,8 @@ class Inventory(object):
def _filter_hosts(self, initial_hostnames, deploy_hostnames):
"""filter out hosts not in deploy hosts"""
filtered_hostnames = []
for hostname in deploy_hostnames:
if hostname in initial_hostnames:
for hostname in initial_hostnames:
if hostname in deploy_hostnames:
filtered_hostnames.append(hostname)
return filtered_hostnames

View File

@ -66,7 +66,7 @@ class TestFunctional(KollaCliTest):
# destroy services, initialize server
try:
self.run_cli_cmd('host destroy %s' % hostname)
self.run_cli_cmd('host destroy %s --includedata' % hostname)
except Exception as e:
self.assertFalse(is_physical_host, '1st destroy exception: %s' % e)
self.assertIn(UNKNOWN_HOST, '%s' % e,
@ -109,7 +109,7 @@ class TestFunctional(KollaCliTest):
# destroy services (via --stop flag)
try:
self.run_cli_cmd('host destroy %s --stop' % hostname)
self.run_cli_cmd('host destroy %s --stop --includedata' % hostname)
except Exception as e:
self.assertFalse(is_physical_host, '2nd destroy exception: %s' % e)
self.assertIn(UNKNOWN_HOST, '%s' % e,