コード例 #1
0
ファイル: gofedSystem.py プロジェクト: fridex/gofed-ng
    def _generate_status(self):
        ret = {
            "author": get_user(),
            "generated": get_time_str(),
            "gofed_version": VERSION,
            "hostname": get_hostname(),
            "topology": []
        }
        system = System(self.get_config(), self.get_system_json_path())

        for service_name in system.get_services_list():
            try:
                registry_response = system.get_service_location(service_name)
            except Exception as e:
                log.warning("Encountered error while querying for service '%s', skipping this service ('%s')"
                            % (service_name, str(e)))
            for response in registry_response:
                ret['topology'].append({
                    'service': service_name,
                    'host': response[0],
                    'port': response[1],
                    'type': 'computational' if system.is_computational(service_name) else 'storage'
                })

        ret['topology'].append({
            'type': 'registry',
            'host': system.get_registry_host(),
            'port': system.get_registry_port()
        })

        print dict2json(ret)
コード例 #2
0
ファイル: bootstrap.py プロジェクト: fridex/gofed-ng
    def _make_header(self, services):
        ret = {}

        ret['gofed_version'] = VERSION
        ret['author'] = get_user()
        ret['hostname'] = get_hostname()
        ret['generated'] = get_time_str()
        ret['services'] = {}
        ret['services']['computational'] = services['computational']
        ret['services']['storages'] = services['storages']
        ret['git_head'] = get_githead()

        return ret
コード例 #3
0
ファイル: bootstrap.py プロジェクト: pombredanne/gofed-ng
    def _make_header(self, services):
        ret = {}

        ret['gofed_version'] = VERSION
        ret['author'] = get_user()
        ret['hostname'] = get_hostname()
        ret['generated'] = get_time_str()
        ret['services'] = {}
        ret['services']['computational'] = services['computational']
        ret['services']['storages'] = services['storages']
        ret['git_head'] = get_githead()

        return ret
コード例 #4
0
ファイル: gofedSystem.py プロジェクト: pombredanne/gofed-ng
    def _generate_status(self):
        ret = {
            "author": get_user(),
            "generated": get_time_str(),
            "gofed_version": VERSION,
            "hostname": get_hostname(),
            "topology": []
        }
        system = System(self.get_config(), self.get_system_json_path())

        for service_name in system.get_services_list():
            try:
                registry_response = system.get_service_location(service_name)
            except Exception as e:
                log.warning(
                    "Encountered error while querying for service '%s', skipping this service ('%s')"
                    % (service_name, str(e)))
            for response in registry_response:
                ret['topology'].append({
                    'service':
                    service_name,
                    'host':
                    response[0],
                    'port':
                    response[1],
                    'type':
                    'computational'
                    if system.is_computational(service_name) else 'storage'
                })

        ret['topology'].append({
            'type': 'registry',
            'host': system.get_registry_host(),
            'port': system.get_registry_port()
        })

        print dict2json(ret)
コード例 #5
0
 def log_service_name(self, name):
     self._stats['meta']['service'] = name
     self._stats['meta']['service-version'] = VERSION
     self._stats['meta']['hostname'] = get_hostname()
     self._stats['meta']['created'] = int(time.time())