Remove the overcloudrc.v3 file

The default file is now v3, so these will always be the same.

Related-Bug: #1733640
Depends-On: I5e779f48a02c5389cebf84e9d3899250d63cace8
Change-Id: I3612c58c356f8955bd44655cf5aacc20be532cbc
This commit is contained in:
Dougal Matthews 2017-11-21 16:45:35 +00:00
parent 9884858f03
commit 977bc6f1b8
5 changed files with 13 additions and 21 deletions

View File

@ -0,0 +1,8 @@
---
deprecations:
- |
List deprecations notes here, or remove this section. All of the list
items in this section are combined when the release notes are rendered, so
the text needs to be worded so that it does not depend on any information
only available in another section, such as the prelude. This may mean
repeating some details.

View File

@ -31,7 +31,6 @@ class TestOvercloudCredentials(test_plugin.TestPluginV1):
output=json.dumps({
"result": {
"overcloudrc": "OVERCLOUDRC CONTENTS",
"overcloudrc.v3": "OVERCLOUDRC.v3 CONTENTS",
}
})
)
@ -49,10 +48,8 @@ class TestOvercloudCredentials(test_plugin.TestPluginV1):
self.cmd.take_action(parsed_args)
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.call('./overcloudrc', 384),
mock.call('./overcloudrc.v3', 384)])
mock.call('./overcloudrc', 384)])
self.workflow.action_executions.create.assert_called_once_with(
'tripleo.deployment.overcloudrc', {'container': 'overcloud'},
@ -75,13 +72,10 @@ class TestOvercloudCredentials(test_plugin.TestPluginV1):
self.cmd.take_action(parsed_args)
path = "{}/overcloudrc".format(temp)
pathv3 = "{}/overcloudrc.v3".format(temp)
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.call(path, 384),
mock.call(pathv3, 384)])
mock.call(path, 384)])
self.workflow.action_executions.create.assert_called_once_with(
'tripleo.deployment.overcloudrc', {'container': 'overcloud'},

View File

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

View File

@ -53,15 +53,11 @@ def write_overcloudrc(stack_name, overcloudrcs, config_directory='.'):
"""Write the overcloudrc files"""
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:
rcfile.write(overcloudrcs['overcloudrc'])
os.chmod(rcpath, 0o600)
with open(rcv3path, 'w') as rcv3file:
rcv3file.write(overcloudrcs['overcloudrc.v3'])
os.chmod(rcv3path, 0o600)
return os.path.abspath(rcpath)

View File

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