Verified Commit 3adb3758 authored by Loïc Dachary's avatar Loïc Dachary Committed by Loïc Dachary

enough: host create adds non existent host to all

Fixes: #238
parent 815ef3f8
......@@ -83,6 +83,7 @@ class HostOpenStack(Host):
self.dotenough.ensure()
def create_or_update(self):
dotenough.Hosts(self.config_dir).ensure(self.args['name'])
h = openstack.Heat(self.config_dir, **self.args)
s = openstack.Stack(self.config_dir, h.get_stack_definition(self.args['name']), **self.args)
s.set_public_key(f'{self.config_dir}/infrastructure_key.pub')
......
......@@ -340,3 +340,20 @@ def test_volume_resize(tmpdir):
o = OpenStack(settings.CONFIG_DIR)
# comment out the following line to re-use the content of the regions and save time
o.destroy_everything(None)
#
# Host
#
@pytest.mark.skipif('SKIP_OPENSTACK_INTEGRATION_TESTS' in os.environ,
reason='skip integration test')
def test_host_create_or_update(tmpdir, openstack_name):
try:
enough = create_enough(tmpdir, 'host')
enough.set_args(name='new-host')
info = enough.host.create_or_update()
assert 'ipv4' in info
finally:
o = OpenStack(settings.CONFIG_DIR)
# comment out the following line to re-use the content of the regions and save time
o.destroy_everything(None)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment