mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Complete initial network-integration support.
This commit is contained in:
@@ -194,6 +194,11 @@ def parse_args():
|
||||
targets=walk_network_integration_targets,
|
||||
config=NetworkIntegrationConfig)
|
||||
|
||||
network_integration.add_argument('--platform',
|
||||
metavar='PLATFORM',
|
||||
action='append',
|
||||
help='network platform/version').completer = complete_network_platform
|
||||
|
||||
windows_integration = subparsers.add_parser('windows-integration',
|
||||
parents=[integration],
|
||||
help='windows integration tests')
|
||||
@@ -503,5 +508,17 @@ def complete_windows(prefix, parsed_args, **_):
|
||||
return [i for i in images if i.startswith(prefix) and (not parsed_args.windows or i not in parsed_args.windows)]
|
||||
|
||||
|
||||
def complete_network_platform(prefix, parsed_args, **_):
|
||||
"""
|
||||
:type prefix: unicode
|
||||
:type parsed_args: any
|
||||
:rtype: list[str]
|
||||
"""
|
||||
with open('test/runner/completion/network.txt', 'r') as completion_fd:
|
||||
images = completion_fd.read().splitlines()
|
||||
|
||||
return [i for i in images if i.startswith(prefix) and (not parsed_args.platform or i not in parsed_args.platform)]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user