mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 08:18:43 -03:30
Add organizations as a resource type to export
This commit is contained in:
@@ -157,6 +157,7 @@ class Export(CustomCommand):
|
|||||||
def extend_parser(self, parser):
|
def extend_parser(self, parser):
|
||||||
resources = parser.add_argument_group('resources')
|
resources = parser.add_argument_group('resources')
|
||||||
resources.add_argument('--users', nargs='?', const='')
|
resources.add_argument('--users', nargs='?', const='')
|
||||||
|
resources.add_argument('--organizations', nargs='?', const='')
|
||||||
|
|
||||||
def get_resources(self, client, resource, value):
|
def get_resources(self, client, resource, value):
|
||||||
api_resource = getattr(client.v2, resource)
|
api_resource = getattr(client.v2, resource)
|
||||||
@@ -182,7 +183,7 @@ class Export(CustomCommand):
|
|||||||
parsed = parser.parse_known_args()[0]
|
parsed = parser.parse_known_args()[0]
|
||||||
|
|
||||||
data = {}
|
data = {}
|
||||||
for resource in ('users',):
|
for resource in ('users', 'organizations'):
|
||||||
value = getattr(parsed, resource, None)
|
value = getattr(parsed, resource, None)
|
||||||
if value is None:
|
if value is None:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user