コード例 #1
0
ファイル: verify.py プロジェクト: kenkeiras/subuser
def rebuildBinDir(user):
    if os.path.exists(user.getConfig()["bin-dir"]):
        shutil.rmtree(user.getConfig()["bin-dir"])
    os.mkdir(user.getConfig()["bin-dir"])
    for _, subuser in user.getRegistry().getSubusers().items():
        if subuser.isExecutableShortcutInstalled():
            subuser.installExecutableShortcut()
コード例 #2
0
ファイル: verify.py プロジェクト: talwrii/subuser
def rebuildBinDir(user):
  if os.path.exists(user.getConfig()["bin-dir"]):
    shutil.rmtree(user.getConfig()["bin-dir"])
  os.mkdir(user.getConfig()["bin-dir"])
  for _,subuser in user.getRegistry().getSubusers().items():
    if subuser.isExecutableShortcutInstalled():
      subuser.installExecutableShortcut()
コード例 #3
0
 def save(self):
     """
  Save the list of subusers to disk.
 """
     serializedUnlockedSubusersDict = {}
     serializedLockedSubusersDict = {}
     for subuserName, subuser in self.items():
         serializedSubuser = {}
         serializedSubuser["source-repo"] = subuser.getImageSource(
         ).getRepository().getName()
         serializedSubuser["image-source"] = subuser.getImageSource(
         ).getName()
         serializedSubuser[
             "executable-shortcut-installed"] = subuser.isExecutableShortcutInstalled(
             )
         serializedSubuser["docker-image"] = subuser.getImageId()
         if subuser.locked():
             serializedLockedSubusersDict[subuserName] = serializedSubuser
         else:
             serializedUnlockedSubusersDict[subuserName] = serializedSubuser
     with open(
             os.path.join(self.getUser().getConfig()["registry-dir"],
                          "subusers.json"), 'w') as file_f:
         json.dump(serializedUnlockedSubusersDict,
                   file_f,
                   indent=1,
                   separators=(',', ': '))
     with open(
             os.path.join(
                 self.getUser().getConfig()["locked-subusers-path"]),
             'w') as file_f:
         json.dump(serializedLockedSubusersDict,
                   file_f,
                   indent=1,
                   separators=(',', ': '))
コード例 #4
0
 def save(self):
     """
  Save the list of subusers to disk.
 """
     serializedSubusersDict = {}
     for subuserName, subuser in self.iteritems():
         serializedSubusersDict[subuserName] = {}
         serializedSubusersDict[subuserName][
             "source-repo"] = subuser.getImageSource().getRepository(
             ).getName()
         serializedSubusersDict[subuserName][
             "image-source"] = subuser.getImageSource().getName()
         serializedSubusersDict[subuserName][
             "executable-shortcut-installed"] = subuser.isExecutableShortcutInstalled(
             )
         serializedSubusersDict[subuserName][
             "docker-image"] = subuser.getImageId()
     with open(
             os.path.join(
                 self.getUser().getConfig().getSubusersDotJsonPath()),
             'w') as file_f:
         json.dump(serializedSubusersDict,
                   file_f,
                   indent=1,
                   separators=(',', ': '))
コード例 #5
0
def rebuildBinDir(user):
  if os.path.exists(user.getConfig()["bin-dir"]):
    shutil.rmtree(user.getConfig()["bin-dir"])
  user.getEndUser().mkdir(user.getConfig()["bin-dir"])
  for _,subuser in user.getRegistry().getSubusers().items():
    if subuser.isExecutableShortcutInstalled():
      subuser.installExecutableShortcut()
    if subuser.areEntryPointsExposed():
      subuser.exposeEntrypoints()
コード例 #6
0
ファイル: subusers.py プロジェクト: takluyver/subuser
 def save(self):
   """
    Save the list of subusers to disk.
   """
   serializedSubusersDict = {}
   for subuserName,subuser in self.iteritems():
     serializedSubusersDict[subuserName] = {}
     serializedSubusersDict[subuserName]["source-repo"] = subuser.getImageSource().getRepository().getName()
     serializedSubusersDict[subuserName]["image-source"] = subuser.getImageSource().getName()
     serializedSubusersDict[subuserName]["executable-shortcut-installed"] = subuser.isExecutableShortcutInstalled()
     serializedSubusersDict[subuserName]["docker-image"] = subuser.getImageId()
   with open(os.path.join(self.getUser().getConfig().getSubusersDotJsonPath()), 'w') as file_f:
     json.dump(serializedSubusersDict, file_f, indent=1, separators=(',', ': '))