Example #1
0
 def build_host(self):
     build_str = "\thost {0} {{\n".format(self.get_fqdn())
     build_str += "\t\thardware ethernet {0};\n".format(
         format_mac(self.mac))
     """
     options = self.dynamicintrkeyvalue_set.filter(is_option=True)
     statements = self.dynamicintrkeyvalue_set.filter(is_statement=True)
     if options:
         build_str += "\t\t# Host Options\n"
         build_str += join_dhcp_args(options, depth=2)
     if statements:
         build_str += "\t\t# Host Statemets\n"
         build_str += join_dhcp_args(statements, depth=2)
     """
     build_str += "\t}\n\n"
     return build_str
Example #2
0
 def build_host(self):
     build_str = "\thost {0} {{\n".format(self.get_fqdn())
     build_str += "\t\thardware ethernet {0};\n".format(format_mac(
         self.mac))
     """
     options = self.dynamicintrkeyvalue_set.filter(is_option=True)
     statements = self.dynamicintrkeyvalue_set.filter(is_statement=True)
     if options:
         build_str += "\t\t# Host Options\n"
         build_str += join_dhcp_args(options, depth=2)
     if statements:
         build_str += "\t\t# Host Statemets\n"
         build_str += join_dhcp_args(statements, depth=2)
     """
     build_str += "\t}\n\n"
     return build_str
Example #3
0
 def build_host(self):
     build_str = '\thost {0} {{\n'.format(self.fqdn)
     build_str += '\t\thardware ethernet {0};\n'.format(
         format_mac(self.mac))
     if self.ip_type == IP_TYPE_6:
         build_str += '\t\tfixed-address6 {0};\n'.format(self.ip_str)
     else:
         build_str += '\t\tfixed-address {0};\n'.format(self.ip_str)
     """
     options = self.staticintrkeyvalue_set.filter(is_option=True)
     statements = self.staticintrkeyvalue_set.filter(is_statement=True)
     if options:
         build_str += '\t\t# Host Options\n'
         build_str += join_dhcp_args(options, depth=2)
     if statements:
         build_str += '\t\t# Host Statements\n'
         build_str += join_dhcp_args(statements, depth=2)
     """
     build_str += '\t}\n\n'
     return build_str
Example #4
0
 def build_subclass(self, allowed):
     return "subclass \"{0}:{1}:{2}\" 1:{3};\n".format(
         allowed, self.range.start_str, self.range.end_str,
         format_mac(self.mac))
Example #5
0
 def build_subclass(self, contained_range, allowed):
     return "subclass \"{0}:{1}:{2}\" 1:{3};\n".format(
         allowed.name, contained_range.start_str, contained_range.end_str,
         format_mac(self.mac))
Example #6
0
 def build_subclass(self, allowed):
     return "subclass \"{0}:{1}:{2}\" 1:{3};\n".format(
         allowed, self.range.start_str, self.range.end_str,
         format_mac(self.mac))