|
15 | 15 | from kvirt import examples |
16 | 16 | from kvirt.nameutils import get_random_name |
17 | 17 | from kvirt.baseconfig import Kbaseconfig |
18 | | -from kvirt.common import error, pprint, success, warning, ssh, _ssh_credentials, container_mode |
| 18 | +from kvirt.common import error, pprint, success, warning, ssh, _ssh_credentials, container_mode, filter_info_plan |
19 | 19 | from kvirt.common import get_git_version, compare_git_versions, interactive_kube, interactive_vm, convert_yaml_to_cmd |
20 | 20 | from kvirt.config import Kconfig |
21 | 21 | from kvirt.containerconfig import Kcontainerconfig |
@@ -742,28 +742,6 @@ def _filter_list(_list, overrides={}): |
742 | 742 | return new_list |
743 | 743 |
|
744 | 744 |
|
745 | | -def _filter_info_plan(_list, overrides={}): |
746 | | - new_list = [] |
747 | | - name = overrides.get('name') |
748 | | - field = overrides.get('field') |
749 | | - value = overrides.get('value') |
750 | | - for entry in _list: |
751 | | - new_entry = entry |
752 | | - if field is not None: |
753 | | - if field not in entry: |
754 | | - continue |
755 | | - if value is not None and entry[field] != value: |
756 | | - continue |
757 | | - if name is not None: |
758 | | - if entry['name'] == name: |
759 | | - return entry[field] |
760 | | - else: |
761 | | - continue |
762 | | - new_entry = {entry['name']: entry[field]} |
763 | | - new_list.append(new_entry) |
764 | | - return new_list |
765 | | - |
766 | | - |
767 | 745 | def _parse_vms_list(_list, overrides={}): |
768 | 746 | if isinstance(_list, str): |
769 | 747 | print(_list) |
@@ -2228,7 +2206,7 @@ def info_plan(args): |
2228 | 2206 | namespace=args.namespace) |
2229 | 2207 | _list = config.info_specific_plan(args.plan, quiet=quiet) |
2230 | 2208 | if overrides: |
2231 | | - _list = _filter_info_plan(_list, overrides) |
| 2209 | + _list = filter_info_plan(_list, overrides) |
2232 | 2210 | if output is not None: |
2233 | 2211 | _list_output(_list, output) |
2234 | 2212 | else: |
|
0 commit comments