Deprecate --standalone argument

The only effect the argument had previously was to prevent the command
from throwing an exception when it was not passed.

However, the argument did not actually prevent non-standalone
deployments. It was still possible to deploy multinode or single remote
node deployments using tripleo deploy even when passing --standalone.

This patch deprecates the --standalone argument and adds help text to
indicate that it's no longer needed. Continuing to pass the argument
will have no change in behavior.

blueprint tripleo-deploy-multinode
Change-Id: I6d390f3b201ad681d977a12fd627e610ad7b65f0
Signed-off-by: James Slagle <jslagle@redhat.com>
This commit is contained in:
James Slagle 2020-05-06 14:40:53 -04:00 committed by Emilien Macchi
parent c8736dff0c
commit a5381b2169
3 changed files with 18 additions and 22 deletions

View File

@ -0,0 +1,7 @@
---
deprecations:
- |
The --standalone argument to the openstack tripleo deploy command is now
deprecated. The argument previously had no effect other than allow the
tripleo deploy command to not throw an exception, so it can be safely
deprecated with no replacement.

View File

@ -938,8 +938,7 @@ class TestDeployUndercloud(TestPluginV1):
'-e', '/tmp/thtroot42/notouch.yaml',
'-e', '~/custom.yaml',
'-e', 'something.yaml',
'-e', '../../../outside.yaml',
'--standalone'], [])
'-e', '../../../outside.yaml'], [])
mock_file_exists.return_value = True
fake_orchestration = mock_launchheat(parsed_args)
@ -977,8 +976,7 @@ class TestDeployUndercloud(TestPluginV1):
['--local-ip', '127.0.0.1',
'--templates', '/tmp/thtroot',
'--stack', 'undercloud',
'--output-dir', '/my',
'--standalone'], [])
'--output-dir', '/my'], [])
self.assertRaises(exceptions.DeploymentError,
self.cmd.take_action, parsed_args)
mock_copy.assert_called_once()
@ -989,8 +987,7 @@ class TestDeployUndercloud(TestPluginV1):
['--local-ip', '127.0.0.1',
'--templates', '/tmp/thtroot',
'--stack', 'undercloud',
'--output-dir', '/my',
'--standalone'], [])
'--output-dir', '/my'], [])
self.cmd._set_stack_action(parsed_args)
self.assertEqual('CREATE', self.cmd.stack_action)
@ -1000,8 +997,7 @@ class TestDeployUndercloud(TestPluginV1):
['--local-ip', '127.0.0.1',
'--templates', '/tmp/thtroot',
'--stack', 'undercloud',
'--output-dir', '/my',
'--standalone'], [])
'--output-dir', '/my'], [])
self.cmd._set_stack_action(parsed_args)
self.assertEqual('UPDATE', self.cmd.stack_action)
@ -1012,7 +1008,6 @@ class TestDeployUndercloud(TestPluginV1):
'--templates', '/tmp/thtroot',
'--stack', 'undercloud',
'--output-dir', '/my',
'--standalone',
'--force-stack-update'], [])
self.cmd._set_stack_action(parsed_args)
self.assertEqual('UPDATE', self.cmd.stack_action)
@ -1024,7 +1019,6 @@ class TestDeployUndercloud(TestPluginV1):
'--templates', '/tmp/thtroot',
'--stack', 'undercloud',
'--output-dir', '/my',
'--standalone',
'--force-stack-create'], [])
self.cmd._set_stack_action(parsed_args)
self.assertEqual('CREATE', self.cmd.stack_action)
@ -1039,7 +1033,6 @@ class TestDeployUndercloud(TestPluginV1):
'--templates', '/tmp/thtroot',
'--stack', 'undercloud',
'--output-dir', '/my',
'--standalone',
'--force-stack-create',
'--force-stack-update'], [])
@ -1100,8 +1093,7 @@ class TestDeployUndercloud(TestPluginV1):
'--templates', '/tmp/thtroot',
'--stack', 'undercloud',
'--output-dir', '/my',
'--output-only',
'--standalone'], [])
'--output-only'], [])
rc = self.cmd.take_action(parsed_args)
self.assertEqual(None, rc)

View File

@ -908,8 +908,10 @@ class Deploy(command.Command):
default=constants.TRIPLEO_HEAT_TEMPLATES
)
parser.add_argument('--standalone', default=False, action='store_true',
help=_("Run deployment as a standalone deployment "
"with no undercloud."))
help=_("DEPRECATED. The --standalone argument is "
"now deprecated. Standalone deployments "
"can now be run without passing "
"--standalone. "))
parser.add_argument('--upgrade', default=False, action='store_true',
help=_("Upgrade an existing deployment."))
parser.add_argument('-y', '--yes', default=False, action='store_true',
@ -1408,13 +1410,8 @@ class Deploy(command.Command):
self.log.debug("take_action(%s)" % parsed_args)
try:
if parsed_args.standalone:
if self._standalone_deploy(parsed_args) != 0:
msg = _('Deployment failed.')
self.log.error(msg)
raise exceptions.DeploymentError(msg)
else:
msg = _('Non-standalone is currently not supported')
if self._standalone_deploy(parsed_args) != 0:
msg = _('Deployment failed.')
self.log.error(msg)
raise exceptions.DeploymentError(msg)
finally: