Fuel plugin install --force now can install new plugin
Without this changes fuel return error if you will try to install new plugin using install with --force Change-Id: Id3b2966f78bf24bb47f05b7d0a02bb101b7843b5 Closes-Bug: #1439128
This commit is contained in:
@@ -180,11 +180,12 @@ class PluginV2(BasePlugin):
|
||||
@classmethod
|
||||
@master_only
|
||||
def install(cls, plugin_path, force=False):
|
||||
action = 'install'
|
||||
if force:
|
||||
action = 'reinstall'
|
||||
|
||||
utils.exec_cmd('yum -y {0} {1}'.format(action, plugin_path))
|
||||
utils.exec_cmd(
|
||||
'yum -y install {0} || yum -y reinstall {0}'
|
||||
.format(plugin_path))
|
||||
else:
|
||||
utils.exec_cmd('yum -y install {0}'.format(plugin_path))
|
||||
|
||||
@classmethod
|
||||
@master_only
|
||||
|
||||
@@ -122,7 +122,9 @@ class TestPluginV2(base.UnitTestCase):
|
||||
def test_install_w_force(self, exec_mock, master_only_mock):
|
||||
self.plugin.install(self.path, force=True)
|
||||
|
||||
exec_mock.assert_called_once_with('yum -y reinstall /tmp/plugin/path')
|
||||
exec_mock.assert_called_once_with(
|
||||
'yum -y install /tmp/plugin/path'
|
||||
' || yum -y reinstall /tmp/plugin/path')
|
||||
master_only_mock.assert_called_once_with()
|
||||
|
||||
@patch('fuelclient.objects.plugins.utils.exec_cmd')
|
||||
|
||||
Reference in New Issue
Block a user