'ironic create' handles file args

This fixes the 'ironic create' command so that it handles the
file argument(s) correctly.

Change-Id: I74d42740b10ed2000c3b9f52dfa2e71dcca5e779
Closes-Bug: #1621565
This commit is contained in:
Ruby Loo 2016-09-08 22:07:40 -04:00
parent 910989a9ea
commit 96554a998a
3 changed files with 6 additions and 2 deletions

View File

@ -26,6 +26,6 @@ class TestCreateResourcesShell(utils.BaseTestCase):
def test_create_shell(self, mock_create_resources): def test_create_shell(self, mock_create_resources):
args = mock.MagicMock() args = mock.MagicMock()
files = ['file1', 'file2', 'file3'] files = ['file1', 'file2', 'file3']
args.resource_files = [files] args.resource_files = files
create_resources_shell.do_create(self.client, args) create_resources_shell.do_create(self.client, args)
mock_create_resources.assert_called_once_with(self.client, files) mock_create_resources.assert_called_once_with(self.client, files)

View File

@ -25,4 +25,4 @@ def do_create(cc, args):
create all the resources; those that could not be created are skipped create all the resources; those that could not be created are skipped
(with a corresponding error message). (with a corresponding error message).
""" """
create_resources.create_resources(cc, args.resource_files[0]) create_resources.create_resources(cc, args.resource_files)

View File

@ -0,0 +1,4 @@
---
fixes:
- Fixes 'ironic create <file>' command so that it handles the
file argument(s) correctly.