summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openstackclient/compute/v2/server.py13
-rw-r--r--openstackclient/tests/unit/compute/v2/test_server.py4
-rw-r--r--releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml5
3 files changed, 14 insertions, 8 deletions
diff --git a/openstackclient/compute/v2/server.py b/openstackclient/compute/v2/server.py
index 78c5678..c08f5ca 100644
--- a/openstackclient/compute/v2/server.py
+++ b/openstackclient/compute/v2/server.py
@@ -1056,17 +1056,18 @@ class ListServer(command.Lister):
1056 'all_tenants': parsed_args.all_projects, 1056 'all_tenants': parsed_args.all_projects,
1057 'user_id': user_id, 1057 'user_id': user_id,
1058 'deleted': parsed_args.deleted, 1058 'deleted': parsed_args.deleted,
1059 'changes_since': parsed_args.changes_since, 1059 'changes-since': parsed_args.changes_since,
1060 } 1060 }
1061 LOG.debug('search options: %s', search_opts) 1061 LOG.debug('search options: %s', search_opts)
1062 1062
1063 if search_opts['changes_since']: 1063 if search_opts['changes-since']:
1064 try: 1064 try:
1065 timeutils.parse_isotime(search_opts['changes_since']) 1065 timeutils.parse_isotime(search_opts['changes-since'])
1066 except ValueError: 1066 except ValueError:
1067 raise exceptions.CommandError(_('Invalid changes-since value:' 1067 raise exceptions.CommandError(
1068 ' %s') % search_opts['changes' 1068 _('Invalid changes-since value: %s') %
1069 '_since']) 1069 search_opts['changes-since']
1070 )
1070 1071
1071 if parsed_args.long: 1072 if parsed_args.long:
1072 columns = ( 1073 columns = (
diff --git a/openstackclient/tests/unit/compute/v2/test_server.py b/openstackclient/tests/unit/compute/v2/test_server.py
index 20b9532..c4e125b 100644
--- a/openstackclient/tests/unit/compute/v2/test_server.py
+++ b/openstackclient/tests/unit/compute/v2/test_server.py
@@ -1584,7 +1584,7 @@ class TestServerList(TestServer):
1584 'all_tenants': False, 1584 'all_tenants': False,
1585 'user_id': None, 1585 'user_id': None,
1586 'deleted': False, 1586 'deleted': False,
1587 'changes_since': None, 1587 'changes-since': None,
1588 } 1588 }
1589 1589
1590 # Default params of the core function of the command in the case of no 1590 # Default params of the core function of the command in the case of no
@@ -1791,7 +1791,7 @@ class TestServerList(TestServer):
1791 parsed_args = self.check_parser(self.cmd, arglist, verifylist) 1791 parsed_args = self.check_parser(self.cmd, arglist, verifylist)
1792 columns, data = self.cmd.take_action(parsed_args) 1792 columns, data = self.cmd.take_action(parsed_args)
1793 1793
1794 self.search_opts['changes_since'] = '2016-03-04T06:27:59Z' 1794 self.search_opts['changes-since'] = '2016-03-04T06:27:59Z'
1795 self.search_opts['deleted'] = True 1795 self.search_opts['deleted'] = True
1796 self.servers_mock.list.assert_called_with(**self.kwargs) 1796 self.servers_mock.list.assert_called_with(**self.kwargs)
1797 1797
diff --git a/releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml b/releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml
new file mode 100644
index 0000000..d792f25
--- /dev/null
+++ b/releasenotes/notes/bug-1732216-b41bfedebff911e1.yaml
@@ -0,0 +1,5 @@
1---
2fixes:
3 - |
4 Fix the operation of the ``--changes-since`` option to the ``server list`` command.
5 [Bug `1732216 <https://bugs.launchpad.net/python-openstackclient/+bug/1732216>`_]