Beispiel #1
0
 def _get_connection(self):
     if self.state not in ["rendered", "parsed"]:
         if self._connection:
             return self._connection
         self._connection = get_resource_connection(self._module)
         return self._connection
     return None
Beispiel #2
0
    def __init__(self, module):
        self._module = module
        self.state = module.params["state"]
        self._connection = None

        if self.state not in ["rendered", "parsed"]:
            self._connection = get_resource_connection(module)
Beispiel #3
0
    def __init__(self, module):
        self._module = module
        self.state = module.params['state']
        self._connection = None

        if self.state not in ['rendered', 'parsed']:
            self._connection = get_resource_connection(module)
Beispiel #4
0
    def __init__(self, module):
        self._module = module
        self._warnings = []
        self._gather_subset = module.params.get('gather_subset')
        self._gather_network_resources = module.params.get('gather_network_resources')
        self._connection = None
        if module.params.get('state') not in ['rendered', 'parsed']:
            self._connection = get_resource_connection(module)

        self.ansible_facts = {'ansible_network_resources': {}}
        self.ansible_facts['ansible_net_gather_network_resources'] = list()
        self.ansible_facts['ansible_net_gather_subset'] = list()

        if not self._gather_subset:
            self._gather_subset = ['!config']
        if not self._gather_network_resources:
            self._gather_network_resources = ['!all']
Beispiel #5
0
    def __init__(self, module):
        self._module = module
        self._warnings = []
        self._gather_subset = module.params.get("gather_subset")
        self._gather_network_resources = module.params.get(
            "gather_network_resources")
        self._connection = None
        if module.params.get("state") not in ["rendered", "parsed"]:
            self._connection = get_resource_connection(module)

        self.ansible_facts = {"ansible_network_resources": {}}
        self.ansible_facts["ansible_net_gather_network_resources"] = list()
        self.ansible_facts["ansible_net_gather_subset"] = list()

        if not self._gather_subset:
            self._gather_subset = ["!config"]
        if not self._gather_network_resources:
            self._gather_network_resources = ["!all"]
Beispiel #6
0
 def __init__(self, module):
     self._module = module
     self._connection = get_resource_connection(self._module)
     device_info = self._connection.get_device_info()
     self._model = device_info.get("network_os_model", "")
     self._platform = device_info.get("network_os_platform", "")