def facts(self): if self._facts is None: if hasattr(self.native, "_facts"): del self.native._facts self._facts = strip_unicode(self.native.facts) self._facts["vendor"] = self.vendor return self._facts
def facts(self): if hasattr(self, '_facts'): return self._facts facts = strip_unicode(self.native.facts) facts['vendor'] = self.vendor self._facts = facts return self._facts
def get(self, vlan_id): vlan_not_in_range_error(vlan_id) vlan_id = str(vlan_id) native_vlan_response = self.native_vlans.get(vlan_id) converted = convert_dict_by_key(native_vlan_response, VLAN_KM) converted['id'] = vlan_id return strip_unicode(converted)
def show_list(self, commands, raw_text=False): if raw_text: encoding = "text" else: encoding = "json" try: return strip_unicode( self._parse_response(self.native.enable(commands, encoding=encoding), raw_text=raw_text) ) except EOSCommandError as e: raise CommandListError(commands, e.commands[len(e.commands) - 1], e.message)
def show_list(self, commands, raw_text=False): if raw_text: encoding = 'text' else: encoding = 'json' try: return strip_unicode( self._parse_response( self.native.enable( commands, encoding=encoding), raw_text=raw_text)) except EOSCommandError as e: raise CommandListError(commands, e.commands[len(e.commands) - 1], e.message)
def show_list(self, commands, raw_text=False): try: return strip_unicode(self.native.show_list(commands, raw_text=raw_text)) except CLIError as e: raise CommandListError(commands, e.command, str(e))
def get_list(self): native_all_vlan_response = self.native_vlans.getall() extracted_vlan_ids = sorted(list(native_all_vlan_response.keys())) return strip_unicode(extracted_vlan_ids)
def show_list(self, commands, raw_text=False): try: return strip_unicode( self.native.show_list(commands, raw_text=raw_text)) except CLIError as e: raise CommandListError(commands, e.command, str(e))