Ejemplo n.º 1
0
 def find_services(self):
     services = {}
     for name in os.listdir(self.services_dir):
         path = os.path.join(self.services_dir, name)
         for version in os.listdir(path):
             full_path = os.path.join(path, version)
             conf_path = os.path.join(full_path, "conf.json")
             last_build_path = os.path.join(full_path, ".last_build.json")
             try:
                 with open(conf_path, 'r') as cf:
                     s = {
                         "service": json.load(cf),
                         "path": full_path,
                         "name": name,
                         "version": version
                     }
                     if os.path.isfile(last_build_path):
                         with open(last_build_path, 'r') as lbf:
                             s["last_build"] = json.load(lbf)
                     services[name + '-' + version] = s
             except IOError:
                 error_log(
                     self.TAG,
                     "Could not build service: {0}".format(name + "-" +
                                                           version))
     return services
Ejemplo n.º 2
0
 def find_apps(self):
     apps = {}
     for path in os.listdir(self.apps_dir):
         app_path = os.path.join(self.apps_dir, path)
         spec_path = os.path.join(app_path, "spec.json")
         try:
             with open(spec_path, 'r') as sf:
                 spec = json.load(sf)
                 m = self._build_meta(spec, app_path)
                 apps[spec["name"]] = m
         except IOError as e:
             error_log(self.TAG, "Could not build app: {0}".format(path))
     return apps
Ejemplo n.º 3
0
 def find_apps(self):
     apps = {}
     for path in os.listdir(self.apps_dir):
         app_path = os.path.join(self.apps_dir, path)
         spec_path = os.path.join(app_path, "spec.json")
         try:
             with open(spec_path, 'r') as sf:
                 spec = json.load(sf)
                 m = self._build_meta(spec, app_path)
                 apps[spec["name"]] = m
         except IOError as e:
             error_log(self.TAG,"Could not build app: {0}".format(path))
     return apps
Ejemplo n.º 4
0
 def find_services(self):
     services = {}
     for name in os.listdir(self.services_dir):
         path = os.path.join(self.services_dir, name)
         for version in os.listdir(path):
             full_path = os.path.join(path, version)
             conf_path = os.path.join(full_path, "conf.json")
             last_build_path = os.path.join(full_path, ".last_build.json")
             try:
                 with open(conf_path, 'r') as cf:
                     s = {
                         "service": json.load(cf),
                         "path": full_path,
                         "name": name,
                         "version": version
                     }
                     if os.path.isfile(last_build_path):
                         with open(last_build_path, 'r') as lbf:
                             s["last_build"] = json.load(lbf)
                     services[name + '-' + version] = s
             except IOError:
                 error_log(self.TAG, "Could not build service: {0}".format(name + "-" + version))
     return services