コード例 #1
0
ファイル: api_ssh.py プロジェクト: kudlatyamroth/armada
    def GET(self):
        try:
            ssh_address = get_container_ssh_address(socket.gethostname())
        except Exception as e:
            return self.status_exception("Cannot inspect own container.", e)

        return self.status_ok({'ssh': ssh_address, 'path': HERMES_DIRECTORY})
コード例 #2
0
    def GET(self):
        try:
            ssh_address = get_container_ssh_address(socket.gethostname())
        except Exception as e:
            return self.status_exception("Cannot inspect own container.", e)

        return self.status_ok({'ssh': ssh_address, 'path': HERMES_DIRECTORY})
コード例 #3
0
ファイル: api_ssh.py プロジェクト: hunterfu/armada
    def GET(self):
        try:
            ssh_address = get_container_ssh_address(socket.gethostname())
        except Exception as e:
            return self.status_error("Cannot inspect own container. {exception_class} - {exception}".format(
                    exception_class=type(e).__name__, exception=str(e)))

        return self.status_ok({'ssh': ssh_address, 'path': HERMES_DIRECTORY})
コード例 #4
0
ファイル: api_ssh.py プロジェクト: hunterfu/armada
    def GET(self):
        try:
            ssh_address = get_container_ssh_address(socket.gethostname())
        except Exception as e:
            return self.status_error(
                "Cannot inspect own container. {exception_class} - {exception}"
                .format(exception_class=type(e).__name__, exception=str(e)))

        return self.status_ok({'ssh': ssh_address, 'path': HERMES_DIRECTORY})
コード例 #5
0
ファイル: hermes_init.py プロジェクト: biggtfish/armada
def _fetch_hermes_from_couriers(courier_addresses):
    my_ssh_address = get_container_ssh_address(socket.gethostname())
    for courier_address in courier_addresses:
        courier_url = 'http://{courier_address}/update_hermes'.format(**locals())
        try:
            payload = { 'ssh': my_ssh_address, 'path': HERMES_DIRECTORY }
            requests.post(courier_url, json.dumps(payload))
        except Exception as e:
            _print_err('Fetching all sources from courier {courier_address} failed: {e}'.format(**locals()))
コード例 #6
0
def _fetch_hermes_from_couriers(courier_addresses):
    my_ssh_address = get_container_ssh_address(socket.gethostname())
    for courier_address in courier_addresses:
        courier_url = 'http://{courier_address}/update_hermes'.format(**locals())
        try:
            payload = {'ssh': my_ssh_address, 'path': HERMES_DIRECTORY}
            requests.post(courier_url, json.dumps(payload))
        except Exception as e:
            _print_err('Fetching all sources from courier {courier_address} failed: {e}'.format(**locals()))
コード例 #7
0
ファイル: api_ssh.py プロジェクト: kudlatyamroth/armada
    def GET(self):
        container_id, error = self.get_get_parameter('container_id')
        if error:
            return self.status_error(error)

        try:
            ssh_address = get_container_ssh_address(container_id)
        except Exception as e:
            return self.status_exception("Cannot inspect requested container.", e)

        return self.status_ok({'ssh': ssh_address})
コード例 #8
0
ファイル: api_ssh.py プロジェクト: firesoft/armada
    def on_get(self, req, resp):
        container_id, error = self.get_get_parameter(req, 'container_id')
        if error:
            return self.status_error(resp, error)

        try:
            ssh_address = get_container_ssh_address(container_id)
        except Exception as e:
            return self.status_exception(resp, "Cannot inspect requested container.", e)

        return self.status_ok(resp, {'ssh': ssh_address})
コード例 #9
0
ファイル: api_ssh.py プロジェクト: hunterfu/armada
    def GET(self):
        container_id, error = self.get_get_parameter('container_id')
        if error:
            return self.status_error(error)

        try:
            ssh_address = get_container_ssh_address(container_id)
        except Exception as e:
            return self.status_error("Cannot inspect requested container. {exception_class} - {exception}".format(
                    exception_class=type(e).__name__, exception=str(e)))

        return self.status_ok({'ssh': ssh_address})
コード例 #10
0
    def GET(self):
        container_id, error = self.get_get_parameter('container_id')
        if error:
            return self.status_error(error)

        try:
            ssh_address = get_container_ssh_address(container_id)
        except Exception as e:
            return self.status_exception("Cannot inspect requested container.",
                                         e)

        return self.status_ok({'ssh': ssh_address})
コード例 #11
0
ファイル: api_ssh.py プロジェクト: hunterfu/armada
    def GET(self):
        container_id, error = self.get_get_parameter('container_id')
        if error:
            return self.status_error(error)

        try:
            ssh_address = get_container_ssh_address(container_id)
        except Exception as e:
            return self.status_error(
                "Cannot inspect requested container. {exception_class} - {exception}"
                .format(exception_class=type(e).__name__, exception=str(e)))

        return self.status_ok({'ssh': ssh_address})
コード例 #12
0
ファイル: hermes_init.py プロジェクト: armadaplatform/armada
def _fetch_hermes_from_couriers(courier_addresses):
    my_ssh_address = get_container_ssh_address(socket.gethostname())
    for courier_address in courier_addresses:
        courier_url = 'http://{courier_address}/update_hermes'.format(**locals())
        try:
            payload = {'ssh': my_ssh_address, 'path': HERMES_DIRECTORY}
            response = requests.post(courier_url, json.dumps(payload))
            response.raise_for_status()
            if response.text.strip() != 'ok':
                raise Exception('Error response from courier:\n{}'.format(response.text))
        except Exception as e:
            get_logger().error('Fetching all sources from courier %s failed:', courier_address)
            get_logger().exception(e)
コード例 #13
0
ファイル: hermes_init.py プロジェクト: zhengxiongwei/armada
def _fetch_hermes_from_couriers(courier_addresses):
    my_ssh_address = get_container_ssh_address(socket.gethostname())
    for courier_address in courier_addresses:
        courier_url = 'http://{courier_address}/update_hermes'.format(**locals())
        try:
            payload = {'ssh': my_ssh_address, 'path': HERMES_DIRECTORY}
            response = requests.post(courier_url, json.dumps(payload))
            response.raise_for_status()
            if response.text.strip() != 'ok':
                raise Exception('Error response from courier:\n{}'.format(response.text))
        except Exception as e:
            get_logger().error('Fetching all sources from courier %s failed:', courier_address)
            get_logger().exception(e)