def normalize_ipv6_values(self, value): ''' @param value - is a dictionary that contains ipv6 prefix and gateway. ''' value['prefix'] = util.normalize_ipv6_address(value['prefix']) value['gateway'] = util.normalize_ipv6_address(value['gateway']) return value
def get_cli(self): 'Override the default implementation to take care / delimiter' assert self.has_ifc_delta_cfg() config = util.normalize_param_dict(self.delta_ifc_cfg_value['value']) config['ipv6_address_with_prefix'] = util.normalize_ipv6_address(config['ipv6_address_with_prefix']) eui64 = config.get('eui64') eui64 = ' eui-64' if eui64 else '' result = 'ipv6 address ' + config['ipv6_address_with_prefix'] result += eui64 return ' '.join(result.split())
def create_asa_key(self): assert self.has_ifc_delta_cfg() value = util.normalize_param_dict(self.delta_ifc_cfg_value['value']) if value['prefix_or_default'] != 'default': value['prefix_or_default'] = util.normalize_ipv6_address(value['prefix_or_default']) d1 = value.get('valid_lifetime_in_seconds') d2 = value.get('prefered_lifetime_in_seconds') if d1 and d2: t1 = d1.split() t2 = d2.split() if len(t1) > 3: d1 = ' '.join(t1[0:3]) if len(t2) > 3: d2 = ' '.join(t2[0:3]) value['valid_lifetime_in_seconds'] = d1 value['prefered_lifetime_in_seconds'] = d2 return self.asa_gen_template % value
def get_cli(self): 'Override the default implementation to take care / delimiter' assert self.has_ifc_delta_cfg() config = util.normalize_param_dict(self.delta_ifc_cfg_value['value']) if config['prefix_or_default'] != 'default': config['prefix_or_default'] = util.normalize_ipv6_address(config['prefix_or_default']) valid_lifetime_in_seconds = config.get('valid_lifetime_in_seconds') valid_lifetime_never_expire = config.get('valid_lifetime_never_expire') prefered_lifetime_in_seconds = config.get('prefered_lifetime_in_seconds') prefered_lifetime_never_expire = config.get('prefered_lifetime_never_expire') valid_lifetime_in_date = config.get('valid_lifetime_in_date') prefered_lifetime_in_date = config.get('prefered_lifetime_in_date') s1 = valid_lifetime_in_seconds if valid_lifetime_in_seconds else valid_lifetime_never_expire s2 = prefered_lifetime_in_seconds if prefered_lifetime_in_seconds else prefered_lifetime_never_expire d1 = valid_lifetime_in_date if valid_lifetime_in_date else '' d2 = prefered_lifetime_in_date if prefered_lifetime_in_date else '' result = 'ipv6 nd prefix ' + config['prefix_or_default'] if s1 and s2: result += ' ' + s1 + ' ' + s2 elif d1 and d2: d1 = self.get_date_without_year(d1) d2 = self.get_date_without_year(d2) result += ' at ' + d1 + ' ' + d2 no_advertise = config.get('no_advertise') no_autoconfig = config.get('no_autoconfig') off_link = config.get('off_link') if no_advertise: result += ' no-advertise' else: if off_link: result += ' off-link' if no_autoconfig: result += ' no-autoconfig' return ' '.join(result.split())
def get_cli(self): 'Override the default implementation to take care / delimiter' assert self.has_ifc_delta_cfg() addr = util.normalize_ipv6_address(self.delta_ifc_cfg_value['value']) result = 'ipv6 address ' + addr return ' '.join(result.split())
def create_asa_key(self): assert self.has_ifc_delta_cfg() value = util.normalize_param_dict(self.delta_ifc_cfg_value['value']) value['ipv6_address_with_prefix'] = util.normalize_ipv6_address(value['ipv6_address_with_prefix']) return self.asa_gen_template % value
def get_cli(self): 'Override the default implementation to take care / delimiter' assert self.has_ifc_delta_cfg() config = util.normalize_param_dict(self.delta_ifc_cfg_value['value']) config = util.normalize_ipv6_address(config) return self.asa_gen_template % config
def create_asa_key(self): assert self.has_ifc_delta_cfg() value = util.normalize_param_dict(self.delta_ifc_cfg_value['value']) value['ipv6_address_with_prefix'] = util.normalize_ipv6_address( value['ipv6_address_with_prefix']) return self.asa_gen_template % value