cli2 4.3.0__tar.gz → 4.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. {cli2-4.3.0/cli2.egg-info → cli2-4.3.2}/PKG-INFO +1 -1
  2. {cli2-4.3.0 → cli2-4.3.2}/cli2/ansible/action.py +10 -0
  3. {cli2-4.3.0 → cli2-4.3.2}/cli2/client.py +4 -2
  4. {cli2-4.3.0 → cli2-4.3.2}/cli2/mask.py +3 -0
  5. {cli2-4.3.0 → cli2-4.3.2/cli2.egg-info}/PKG-INFO +1 -1
  6. {cli2-4.3.0 → cli2-4.3.2}/setup.py +1 -1
  7. {cli2-4.3.0 → cli2-4.3.2}/tests/test_client.py +9 -0
  8. {cli2-4.3.0 → cli2-4.3.2}/tests/test_mask.py +3 -0
  9. {cli2-4.3.0 → cli2-4.3.2}/MANIFEST.in +0 -0
  10. {cli2-4.3.0 → cli2-4.3.2}/README.rst +0 -0
  11. {cli2-4.3.0 → cli2-4.3.2}/classifiers.txt +0 -0
  12. {cli2-4.3.0 → cli2-4.3.2}/cli2/__init__.py +0 -0
  13. {cli2-4.3.0 → cli2-4.3.2}/cli2/ansible/__init__.py +0 -0
  14. {cli2-4.3.0 → cli2-4.3.2}/cli2/ansible/playbook.py +0 -0
  15. {cli2-4.3.0 → cli2-4.3.2}/cli2/ansible/variables.py +0 -0
  16. {cli2-4.3.0 → cli2-4.3.2}/cli2/asyncio.py +0 -0
  17. {cli2-4.3.0 → cli2-4.3.2}/cli2/cli.py +0 -0
  18. {cli2-4.3.0 → cli2-4.3.2}/cli2/cli2.py +0 -0
  19. {cli2-4.3.0 → cli2-4.3.2}/cli2/colors.py +0 -0
  20. {cli2-4.3.0 → cli2-4.3.2}/cli2/configuration.py +0 -0
  21. {cli2-4.3.0 → cli2-4.3.2}/cli2/decorators.py +0 -0
  22. {cli2-4.3.0 → cli2-4.3.2}/cli2/display.py +0 -0
  23. {cli2-4.3.0 → cli2-4.3.2}/cli2/examples/__init__.py +0 -0
  24. {cli2-4.3.0 → cli2-4.3.2}/cli2/examples/client.py +0 -0
  25. {cli2-4.3.0 → cli2-4.3.2}/cli2/examples/conf.py +0 -0
  26. {cli2-4.3.0 → cli2-4.3.2}/cli2/examples/example.py +0 -0
  27. {cli2-4.3.0 → cli2-4.3.2}/cli2/examples/example_obj.py +0 -0
  28. {cli2-4.3.0 → cli2-4.3.2}/cli2/examples/nesting.py +0 -0
  29. {cli2-4.3.0 → cli2-4.3.2}/cli2/examples/obj.py +0 -0
  30. {cli2-4.3.0 → cli2-4.3.2}/cli2/examples/obj2.py +0 -0
  31. {cli2-4.3.0 → cli2-4.3.2}/cli2/examples/test.py +0 -0
  32. {cli2-4.3.0 → cli2-4.3.2}/cli2/lock.py +0 -0
  33. {cli2-4.3.0 → cli2-4.3.2}/cli2/log.py +0 -0
  34. {cli2-4.3.0 → cli2-4.3.2}/cli2/node.py +0 -0
  35. {cli2-4.3.0 → cli2-4.3.2}/cli2/sphinx.py +0 -0
  36. {cli2-4.3.0 → cli2-4.3.2}/cli2/table.py +0 -0
  37. {cli2-4.3.0 → cli2-4.3.2}/cli2/test.py +0 -0
  38. {cli2-4.3.0 → cli2-4.3.2}/cli2.egg-info/SOURCES.txt +0 -0
  39. {cli2-4.3.0 → cli2-4.3.2}/cli2.egg-info/dependency_links.txt +0 -0
  40. {cli2-4.3.0 → cli2-4.3.2}/cli2.egg-info/entry_points.txt +0 -0
  41. {cli2-4.3.0 → cli2-4.3.2}/cli2.egg-info/requires.txt +0 -0
  42. {cli2-4.3.0 → cli2-4.3.2}/cli2.egg-info/top_level.txt +0 -0
  43. {cli2-4.3.0 → cli2-4.3.2}/setup.cfg +0 -0
  44. {cli2-4.3.0 → cli2-4.3.2}/tests/test_ansible.py +0 -0
  45. {cli2-4.3.0 → cli2-4.3.2}/tests/test_ansible_variables.py +0 -0
  46. {cli2-4.3.0 → cli2-4.3.2}/tests/test_asyncio.py +0 -0
  47. {cli2-4.3.0 → cli2-4.3.2}/tests/test_cli.py +0 -0
  48. {cli2-4.3.0 → cli2-4.3.2}/tests/test_command.py +0 -0
  49. {cli2-4.3.0 → cli2-4.3.2}/tests/test_configuration.py +0 -0
  50. {cli2-4.3.0 → cli2-4.3.2}/tests/test_decorators.py +0 -0
  51. {cli2-4.3.0 → cli2-4.3.2}/tests/test_display.py +0 -0
  52. {cli2-4.3.0 → cli2-4.3.2}/tests/test_entry_point.py +0 -0
  53. {cli2-4.3.0 → cli2-4.3.2}/tests/test_group.py +0 -0
  54. {cli2-4.3.0 → cli2-4.3.2}/tests/test_inject.py +0 -0
  55. {cli2-4.3.0 → cli2-4.3.2}/tests/test_lock.py +0 -0
  56. {cli2-4.3.0 → cli2-4.3.2}/tests/test_node.py +0 -0
  57. {cli2-4.3.0 → cli2-4.3.2}/tests/test_restful.py +0 -0
  58. {cli2-4.3.0 → cli2-4.3.2}/tests/test_table.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cli2
3
- Version: 4.3.0
3
+ Version: 4.3.2
4
4
  Summary: image:: https://yourlabs.io/oss/cli2/badges/master/pipeline.svg
5
5
  Home-page: https://yourlabs.io/oss/cli2
6
6
  Author: James Pic
@@ -186,6 +186,7 @@ class ActionBase(ActionBase):
186
186
  for value in self.masked_values:
187
187
  if value:
188
188
  self.mask.values.add(value)
189
+ self.mask_initial_values = self.mask.values
189
190
 
190
191
  async def run_wrapped_async(self):
191
192
  self.verbosity = self.task_vars.get('ansible_verbosity', 0)
@@ -232,8 +233,17 @@ class ActionBase(ActionBase):
232
233
  self.exc = exc
233
234
  finally:
234
235
  if self.mask and self.verbosity:
236
+ # this task has a mask, so it's probably a no_log, we're
237
+ # running verbose, print masked result
235
238
  self.print_yaml(self.result)
236
239
 
240
+ if self.mask_initial_values != self.mask.values:
241
+ # this module has discovered new values to mask, update the
242
+ # fact with those values
243
+ self.result['ansible_facts'] = dict(
244
+ mask_values=self.mask.values,
245
+ )
246
+
237
247
  if (
238
248
  self._before_data != UNSET_DEFAULT
239
249
  and self._after_data != UNSET_DEFAULT
@@ -698,7 +698,8 @@ class ModelCommand(Command):
698
698
  return await model.get(id=self['id'].value)
699
699
 
700
700
  async def post_call(self):
701
- await self.client.post_call(self)
701
+ if self.client:
702
+ await self.client.post_call(self)
702
703
 
703
704
 
704
705
  class ModelMetaclass(type):
@@ -1294,7 +1295,8 @@ class ClientCommand(Command):
1294
1295
 
1295
1296
  async def post_call(self):
1296
1297
  """ Call :py:meth:`Client.post_call`. """
1297
- await self.client.post_call(self)
1298
+ if self.client:
1299
+ await self.client.post_call(self)
1298
1300
 
1299
1301
 
1300
1302
  class Client(metaclass=ClientMetaclass):
@@ -119,3 +119,6 @@ class Mask:
119
119
  if self.values:
120
120
  result += f', number_of_values={len(self.values)}'
121
121
  return result + ')'
122
+
123
+ def __bool__(self):
124
+ return bool(self.keys or self.values)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cli2
3
- Version: 4.3.0
3
+ Version: 4.3.2
4
4
  Summary: image:: https://yourlabs.io/oss/cli2/badges/master/pipeline.svg
5
5
  Home-page: https://yourlabs.io/oss/cli2
6
6
  Author: James Pic
@@ -44,7 +44,7 @@ from setuptools import setup
44
44
 
45
45
  setup(
46
46
  name='cli2',
47
- version='4.3.0',
47
+ version='4.3.2',
48
48
  setup_requires='setupmeta',
49
49
  packages=['cli2'],
50
50
  install_requires=[
@@ -1195,3 +1195,12 @@ def test_client_command(client_class, httpx_mock):
1195
1195
  assert Client.cli['model']['get'].client is None
1196
1196
  cmd = Client.cli['model']['find']
1197
1197
  cmd('http://x')
1198
+
1199
+ Client.post_call_called = False
1200
+ cmd = Client.cli['model']['get']
1201
+ cmd()
1202
+ assert not Client.post_call_called
1203
+
1204
+ cmd = Client.cli['request']
1205
+ cmd()
1206
+ assert not Client.post_call_called
@@ -20,3 +20,6 @@ def test_mask():
20
20
  'b': ['***MASKED*** foo ***MASKED***']
21
21
  }
22
22
  assert mask(fixture) == expected
23
+
24
+ assert mask
25
+ assert not cli2.Mask()
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes