Adds correct plugin installing without internet
Fuel no longer tries to connect to internet when installing local plugin Change-Id: I05cb48fb8cff69c46b4c8be93134dffdfffe3102 Closes-Bug: 1467212
This commit is contained in:
parent
555eeac881
commit
561d7363bf
|
@ -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