diff --git a/requirements.txt b/requirements.txt index fa39af776..6ece48cfb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,4 +15,3 @@ six>=1.9.0 # MIT osc-lib>=1.5.1 # Apache-2.0 websocket-client>=0.32.0 # LGPLv2+ tripleo-common>=7.1.0 # Apache-2.0 -instack-undercloud>=7.0.0 # Apache-2.0 diff --git a/tripleoclient/tests/v1/undercloud/test_undercloud.py b/tripleoclient/tests/v1/undercloud/test_undercloud.py index 9e5119f9e..5436f71e8 100644 --- a/tripleoclient/tests/v1/undercloud/test_undercloud.py +++ b/tripleoclient/tests/v1/undercloud/test_undercloud.py @@ -35,8 +35,8 @@ class TestUndercloudInstall(TestPluginV1): # Get the command object to test self.cmd = undercloud.InstallUndercloud(self.app, None) - @mock.patch('instack_undercloud.undercloud.install') - def test_undercloud_install(self, mock_install): + @mock.patch('subprocess.check_call', autospec=True) + def test_undercloud_install(self, mock_subprocess): arglist = [] verifylist = [] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -44,7 +44,7 @@ class TestUndercloudInstall(TestPluginV1): # DisplayCommandBase.take_action() returns two tuples self.cmd.take_action(parsed_args) - mock_install.assert_called_once_with('/usr/share/instack-undercloud') + mock_subprocess.assert_called_with('instack-install-undercloud') class TestUndercloudUpgrade(TestPluginV1): @@ -54,9 +54,8 @@ class TestUndercloudUpgrade(TestPluginV1): # Get the command object to test self.cmd = undercloud.UpgradeUndercloud(self.app, None) - @mock.patch('instack_undercloud.undercloud.install') @mock.patch('subprocess.check_call', autospec=True) - def test_undercloud_upgrade(self, mock_subprocess, mock_install): + def test_undercloud_upgrade(self, mock_subprocess): arglist = [] verifylist = [] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -67,9 +66,8 @@ class TestUndercloudUpgrade(TestPluginV1): mock_subprocess.assert_has_calls( [ mock.call(['sudo', 'yum', 'update', '-y']), + mock.call('instack-upgrade-undercloud'), mock.call(['sudo', 'systemctl', 'restart', 'openstack-nova-api']) ] ) - mock_install.assert_called_once_with('/usr/share/instack-undercloud', - upgrade=True) diff --git a/tripleoclient/v1/undercloud.py b/tripleoclient/v1/undercloud.py index ae46be58d..d22458c17 100644 --- a/tripleoclient/v1/undercloud.py +++ b/tripleoclient/v1/undercloud.py @@ -18,8 +18,6 @@ import logging import subprocess -from instack_undercloud import undercloud - from osc_lib.command import command from tripleoclient import utils @@ -35,7 +33,7 @@ class InstallUndercloud(command.Command): utils.ensure_run_as_normal_user() - undercloud.install('/usr/share/instack-undercloud') + subprocess.check_call("instack-install-undercloud") class UpgradeUndercloud(command.Command): @@ -50,7 +48,7 @@ class UpgradeUndercloud(command.Command): utils.ensure_run_as_normal_user() subprocess.check_call(['sudo', 'yum', 'update', '-y']) - undercloud.install('/usr/share/instack-undercloud', upgrade=True) + subprocess.check_call("instack-upgrade-undercloud") # restart nova-api https://bugzilla.redhat.com/show_bug.cgi?id=1315467 subprocess.check_call(['sudo', 'systemctl', 'restart', 'openstack-nova-api'])