Issue a message to update nodes after updating images

Currently it may be confusing for operators that the image upload
command does not update nodes when uploading new versions of images.
This change adds a reminder to do so.

Change-Id: I834043c559004bbf5eeaf0a611cfa70ff29b7b05
Closes-Bug: #1786970
This commit is contained in:
Dmitry Tantsur 2018-08-14 17:56:56 +02:00
parent 6db32aa15c
commit 9e717d67d7
2 changed files with 9 additions and 0 deletions

View File

@ -432,6 +432,7 @@ class TestUploadOvercloudImage(TestPluginV1):
)
self.assertEqual(mock_subprocess_call.call_count, 0)
self.assertFalse(self.cmd.updated)
@mock.patch('subprocess.check_call', autospec=True)
def test_overcloud_create_update_images(self, mock_subprocess_call):
@ -462,6 +463,7 @@ class TestUploadOvercloudImage(TestPluginV1):
self.app.client_manager.image.images.update.call_count
)
self.assertEqual(mock_subprocess_call.call_count, 2)
self.assertTrue(self.cmd.updated)
class TestUploadOvercloudImageFull(TestPluginV1):

View File

@ -194,6 +194,7 @@ class UploadOvercloudImage(command.Command):
'',
image.created_at))
)
self.updated = True
return None
else:
print('Image "%s" already exists and can be updated'
@ -306,6 +307,7 @@ class UploadOvercloudImage(command.Command):
def take_action(self, parsed_args):
self.log.debug("take_action(%s)" % parsed_args)
glance_client_adaptor = self._get_glance_client_adaptor()
self.updated = False
if parsed_args.platform and not parsed_args.architecture:
raise exceptions.CommandError('You supplied a platform (%s) '
@ -493,3 +495,8 @@ class UploadOvercloudImage(command.Command):
os.path.join(parsed_args.http_boot, 'agent.ramdisk'),
parsed_args.update_existing
)
if self.updated:
print('Some images have been updated in Glance, make sure to '
'rerun\n\topenstack overcloud node configure\nto reflect '
'the changes on the nodes')