Exemple #1
0
    def addaddr(self, addr):
        """
        Add address to to network interface.

        :param str addr: address to add
        :return: nothing
        """
        if self.up:
            subprocess.check_call([constants.IP_BIN, "addr", "add", str(addr), "dev", self.name])
        PyCoreNetIf.addaddr(self, addr)
Exemple #2
0
    def addaddr(self, addr):
        """
        Add address to to network interface.

        :param str addr: address to add
        :return: nothing
        :raises CoreCommandError: when there is a command exception
        """
        if self.up:
            utils.check_cmd([constants.IP_BIN, "addr", "add", str(addr), "dev", self.name])

        PyCoreNetIf.addaddr(self, addr)