Merge "Adds correct plugin installing without internet"
This commit is contained in:
commit
e685d68c1c
|
@ -182,10 +182,12 @@ class PluginV2(BasePlugin):
|
|||
def install(cls, plugin_path, force=False):
|
||||
if force:
|
||||
utils.exec_cmd(
|
||||
'yum -y install {0} || yum -y reinstall {0}'
|
||||
'yum -y install --disablerepo=\'*\' {0} || '
|
||||
'yum -y reinstall --disablerepo=\'*\' {0}'
|
||||
.format(plugin_path))
|
||||
else:
|
||||
utils.exec_cmd('yum -y install {0}'.format(plugin_path))
|
||||
utils.exec_cmd('yum -y install --disablerepo=\'*\' {0}'
|
||||
.format(plugin_path))
|
||||
|
||||
@classmethod
|
||||
@master_only
|
||||
|
|
|
@ -113,7 +113,8 @@ class TestPluginV2(base.UnitTestCase):
|
|||
def test_install(self, exec_mock, master_only_mock):
|
||||
self.plugin.install(self.path)
|
||||
|
||||
exec_mock.assert_called_once_with('yum -y install /tmp/plugin/path')
|
||||
exec_mock.assert_called_once_with(
|
||||
'yum -y install --disablerepo=\'*\' /tmp/plugin/path')
|
||||
master_only_mock.assert_called_once_with()
|
||||
|
||||
@patch('fuelclient.objects.plugins.utils.exec_cmd')
|
||||
|
@ -121,8 +122,8 @@ class TestPluginV2(base.UnitTestCase):
|
|||
self.plugin.install(self.path, force=True)
|
||||
|
||||
exec_mock.assert_called_once_with(
|
||||
'yum -y install /tmp/plugin/path'
|
||||
' || yum -y reinstall /tmp/plugin/path')
|
||||
'yum -y install --disablerepo=\'*\' /tmp/plugin/path'
|
||||
' || yum -y reinstall --disablerepo=\'*\' /tmp/plugin/path')
|
||||
master_only_mock.assert_called_once_with()
|
||||
|
||||
@patch('fuelclient.objects.plugins.utils.exec_cmd')
|
||||
|
|
Loading…
Reference in New Issue