Unset DIB_YUM_REPO_CONF before running undercloud install

This variable doesn't make sense in the context of an undercloud
install because we're not in a chroot so there's no reason to copy
repos in.  It also causes a confusing error message when it's set
because it tries to copy files over themselves.  For the sake of
sanity, let's just always unset it.

Change-Id: Ieb500d21828abcf56277ce056c1051d36bf4e460
This commit is contained in:
Ben Nemec
2016-01-22 22:49:59 +00:00
parent 091087c02a
commit 47f1522f03
2 changed files with 10 additions and 0 deletions

View File

@@ -301,6 +301,12 @@ class TestGenerateEnvironment(BaseTestCase):
env = undercloud._generate_environment('.')
self.assertEqual('', env['UNDERCLOUD_SERVICE_CERTIFICATE'])
def test_remove_dib_yum_repo_conf(self):
self.useFixture(fixtures.EnvironmentVariable('DIB_YUM_REPO_CONF',
'rum_yepo.conf'))
env = undercloud._generate_environment('.')
self.assertNotIn(env, 'DIB_YUM_REPO_CONF')
class TestWritePasswordFile(BaseTestCase):
def test_normal(self):

View File

@@ -648,6 +648,10 @@ def _generate_environment(instack_root):
if instack_env['UNDERCLOUD_SERVICE_CERTIFICATE']:
instack_env['UNDERCLOUD_SERVICE_CERTIFICATE'] = os.path.abspath(
instack_env['UNDERCLOUD_SERVICE_CERTIFICATE'])
# We're not in a chroot so this doesn't make sense, and it causes weird
# errors if it's set.
if instack_env.get('DIB_YUM_REPO_CONF'):
del instack_env['DIB_YUM_REPO_CONF']
_generate_endpoints(instack_env)