Skip to content

Commit c13977f

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "image cache clear: fix value of default target"
2 parents 7e3664f + 0970dd4 commit c13977f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

openstackclient/image/v2/cache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,15 @@ def get_parser(self, prog_name):
194194
"--cache",
195195
action="store_const",
196196
const="cache",
197+
default="both",
197198
dest="target",
198199
help=_("Clears all the cached images"),
199200
)
200201
parser.add_argument(
201202
"--queue",
202203
action="store_const",
203204
const="queue",
205+
default="both",
204206
dest="target",
205207
help=_("Clears all the queued images"),
206208
)

openstackclient/tests/unit/image/v2/test_cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ def setUp(self):
184184
def test_cache_clear_no_option(self):
185185
arglist = []
186186

187-
verifylist = [('target', None)]
187+
verifylist = [('target', 'both')]
188188

189189
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
190190
self.cmd.take_action(parsed_args)
191191

192192
self.assertIsNone(
193-
self.image_client.clear_cache.assert_called_with(None)
193+
self.image_client.clear_cache.assert_called_with('both')
194194
)
195195

196196
def test_cache_clear_queue_option(self):

0 commit comments

Comments
 (0)