Пример #1
0
    def setNetworking(self, iurl):
        """
            Create management bridge.
            This class will try to create a management bridge.
            Note: expected input format: http://www.redhat.com/a/b/c or:
            ftp://10.0.0.23/d/e/f
        """
        self.status = "OK"
        self.rc = True
        self.message = "Created management bridge."

        if rhel6based:
            deployUtil.setService("messagebus", "start")
            deployUtil.setService("libvirtd", "start")

        if deployUtil.preventDuplicate(bridgeName=self._bridgeName):
            self.message = "Bridge management already exists. Skipping " \
                "bridge creation."
            logging.debug(self.message)
        else:
            url, port = deployUtil.getAddress(iurl)
            if url is None:
                self.message = "Failed to parse manager URL!"
                self.status = "FAIL"
                logging.error(self.message)
                #Do not set rc to allow changes from Engine
            else:
                if not self._addNetwork(url, port):
                    self.status = "FAIL"
                    self.rc = False

        self._xmlOutput('SetNetworking', self.status, None, None, self.message)
        return self.rc
Пример #2
0
    def setNetworking(self, iurl):
        """
            Create rhevm bridge.
            This class will try to create a managment bridge named "rehvm". Class
            always succeeds to allow network configuration from managment server
            even in case this class will fail to set the rhevm bridge.
            Note: expected input format: http://www.redhat.com/a/b/c or: ftp://10.0.0.23/d/e/f
        """
        self.status = "OK"
        self.rc = True
        self.message = "Created rhevm bridge."

        if deployUtil.preventDuplicate():
            self.message = "Bridge rhevm already exists. Skipping bridge creation."
            logging.debug(self.message)
        else:
            url, port = deployUtil.getAddress(iurl)
            if url is None:
                self.message = "Failed to parse manager URL!"
                self.status = "FAIL"
                logging.error(self.message)
                #Do not set rc to allow changes from rhev-m.
            else:
                self._addNetwork(url, port)

        self._xmlOutput('SetNetworking', self.status, None, None, self.message)
        return self.rc
Пример #3
0
    def setNetworking(self, iurl):
        """
            Create management bridge.
            This class will try to create a management bridge.
            Note: expected input format: http://www.redhat.com/a/b/c or:
            ftp://10.0.0.23/d/e/f
        """
        self.status = "OK"
        self.rc = True
        self.message = "Created management bridge."

        if rhel6based:
            deployUtil.setService("messagebus", "start")
            deployUtil.setService("libvirtd", "start")

        if deployUtil.preventDuplicate(bridgeName=self._bridgeName):
            self.message = "Bridge management already exists. Skipping " \
                "bridge creation."
            logging.debug(self.message)
        else:
            url, port = deployUtil.getAddress(iurl)
            if url is None:
                self.message = "Failed to parse manager URL!"
                self.status = "FAIL"
                logging.error(self.message)
                # Do not set rc to allow changes from Engine
            else:
                if not self._addNetwork(url, port):
                    self.status = "FAIL"
                    self.rc = False

        self._xmlOutput('SetNetworking', self.status, None, None, self.message)
        return self.rc
Пример #4
0
    def setNetworking(self, iurl):
        """
            Create rhevm bridge.
            This class will try to create a managment bridge named "rehvm". Class
            always succeeds to allow network configuration from managment server
            even in case this class will fail to set the rhevm bridge.
            Note: expected input format: http://www.redhat.com/a/b/c or: ftp://10.0.0.23/d/e/f
        """
        self.status = "OK"
        self.rc = True
        self.message = "Created rhevm bridge."

        if deployUtil.preventDuplicate():
            self.message = "Bridge rhevm already exists. Skipping bridge creation."
            logging.debug(self.message)
        else:
            url, port = deployUtil.getAddress(iurl)
            if url is None:
                self.message = "Failed to parse manager URL!"
                self.status = "FAIL"
                logging.error(self.message)
                #Do not set rc to allow changes from rhev-m.
            else:
                self._addNetwork(url, port)

        self._xmlOutput('SetNetworking', self.status, None, None, self.message)
        return self.rc