Remove overcloudrc.v3 generation

We've been deploying with keystone v3 for some releases now, so it's
time to get rid of this file; given that it's the same content as
overcloudrc.

Change-Id: I137e08213ef7f0f49510e2ebc905e351fb25b85a
Closes-Bug: #1733640
This commit is contained in:
Juan Antonio Osorio Robles 2019-03-05 15:37:56 +02:00
parent b884aed993
commit 3b7e70af2e
5 changed files with 10 additions and 21 deletions

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The overcloudrc.v3 file is no longer generated. The same contents are
available in overcloudrc.

View File

@ -42,7 +42,6 @@ class TestOvercloudCredentials(test_plugin.TestPluginV1):
"status": "SUCCESS", "status": "SUCCESS",
"message": { "message": {
"overcloudrc": "OVERCLOUDRC CONTENTS", "overcloudrc": "OVERCLOUDRC CONTENTS",
"overcloudrc.v3": "OVERCLOUDRC.v3 CONTENTS",
} }
}]) }])
@ -60,10 +59,8 @@ class TestOvercloudCredentials(test_plugin.TestPluginV1):
self.cmd.take_action(parsed_args) self.cmd.take_action(parsed_args)
self.assertIn(mock.call('./overcloudrc', 'w'), m.call_args_list) self.assertIn(mock.call('./overcloudrc', 'w'), m.call_args_list)
self.assertIn(mock.call('./overcloudrc.v3', 'w'), m.call_args_list)
mock_chmod.assert_has_calls([ mock_chmod.assert_has_calls([
mock.call('./overcloudrc', 384), mock.call('./overcloudrc', 384)])
mock.call('./overcloudrc.v3', 384)])
self.workflow.executions.create.assert_called_once_with( self.workflow.executions.create.assert_called_once_with(
'tripleo.deployment.v1.create_overcloudrc', 'tripleo.deployment.v1.create_overcloudrc',
@ -86,13 +83,10 @@ class TestOvercloudCredentials(test_plugin.TestPluginV1):
self.cmd.take_action(parsed_args) self.cmd.take_action(parsed_args)
path = "{}/overcloudrc".format(temp) path = "{}/overcloudrc".format(temp)
pathv3 = "{}/overcloudrc.v3".format(temp)
self.assertIn(mock.call(path, 'w'), m.call_args_list) self.assertIn(mock.call(path, 'w'), m.call_args_list)
self.assertIn(mock.call(pathv3, 'w'), m.call_args_list)
mock_chmod.assert_has_calls([ mock_chmod.assert_has_calls([
mock.call(path, 384), mock.call(path, 384)])
mock.call(pathv3, 384)])
self.workflow.executions.create.assert_called_once_with( self.workflow.executions.create.assert_called_once_with(
'tripleo.deployment.v1.create_overcloudrc', 'tripleo.deployment.v1.create_overcloudrc',

View File

@ -449,25 +449,19 @@ class TestCreateOvercloudRC(TestCase):
tempdir = tempfile.mkdtemp() tempdir = tempfile.mkdtemp()
rcfile = os.path.join(tempdir, 'teststackrc') rcfile = os.path.join(tempdir, 'teststackrc')
rcfile_v3 = os.path.join(tempdir, 'teststackrc.v3')
overcloudrcs = { overcloudrcs = {
"overcloudrc": "overcloudrc not v3", "overcloudrc": "overcloudrc",
"overcloudrc.v3": "overcloudrc.v3",
} }
try: try:
utils.write_overcloudrc(stack_name, overcloudrcs, utils.write_overcloudrc(stack_name, overcloudrcs,
config_directory=tempdir) config_directory=tempdir)
rc = open(rcfile, 'rt').read() rc = open(rcfile, 'rt').read()
self.assertIn('overcloudrc not v3', rc) self.assertEqual('overcloudrc', rc)
rc_v3 = open(rcfile_v3, 'rt').read()
self.assertIn('overcloudrc.v3', rc_v3)
finally: finally:
if os.path.exists(rcfile): if os.path.exists(rcfile):
os.unlink(rcfile) os.unlink(rcfile)
if os.path.exists(rcfile_v3):
os.unlink(rcfile_v3)
os.rmdir(tempdir) os.rmdir(tempdir)

View File

@ -161,15 +161,11 @@ def write_overcloudrc(stack_name, overcloudrcs, config_directory='.'):
"""Write the overcloudrc files""" """Write the overcloudrc files"""
rcpath = os.path.join(config_directory, '%src' % stack_name) rcpath = os.path.join(config_directory, '%src' % stack_name)
rcv3path = os.path.join(config_directory, '%src.v3' % stack_name)
with open(rcpath, 'w') as rcfile: with open(rcpath, 'w') as rcfile:
rcfile.write(overcloudrcs['overcloudrc']) rcfile.write(overcloudrcs['overcloudrc'])
os.chmod(rcpath, 0o600) os.chmod(rcpath, 0o600)
with open(rcv3path, 'w') as rcv3file:
rcv3file.write(overcloudrcs['overcloudrc.v3'])
os.chmod(rcv3path, 0o600)
return os.path.abspath(rcpath) return os.path.abspath(rcpath)

View File

@ -18,7 +18,7 @@ from tripleoclient.workflows import deployment
class OvercloudCredentials(command.Command): class OvercloudCredentials(command.Command):
"""Create the overcloudrc and overcloudrc.v3 files""" """Create the overcloudrc files"""
log = logging.getLogger(__name__ + ".OvercloudCredentials") log = logging.getLogger(__name__ + ".OvercloudCredentials")