本文整理汇总了Python中subuserlib.classes.userOwnedObject.UserOwnedObject类的典型用法代码示例。如果您正苦于以下问题:Python UserOwnedObject类的具体用法?Python UserOwnedObject怎么用?Python UserOwnedObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了UserOwnedObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self,user,subuser):
self.__subuser = subuser
UserOwnedObject.__init__(self,user)
if not self.getSubuser().getImageId():
raise NoRuntimeCacheForSubusersWhichDontHaveExistantImagesException
self.__pathToRuntimeCacheFile = os.path.join(self.getPathToCurrentImagesRuntimeCacheDir(),self.getSubuser().getPermissions().getHash()+".json")
self.load()
开发者ID:peter1000,项目名称:subuser,代码行数:7,代码来源:runtimeCache.py
示例2: __init__
def __init__(self,user,imageId,imageSourceName,sourceRepoId,imageSourceHash):
self.imageId = imageId
self.imageSourceHash = imageSourceHash
self.imageSourceName = imageSourceName
self.sourceRepoId = sourceRepoId
self.__alreadyCheckedForUpdates = None
UserOwnedObject.__init__(self,user)
开发者ID:subuser-security,项目名称:subuser,代码行数:7,代码来源:installedImage.py
示例3: __init__
def __init__(self,user,subusersToBeUpdatedOrInstalled,checkForUpdatesExternally=False):
UserOwnedObject.__init__(self,user)
self.__subusersToBeUpdated = subusersToBeUpdatedOrInstalled
self.__upToDateImageSources = set()
self.__outOfDateImageSources = set()
self.__outOfDateSubusers = None
self.__subusersWhosImagesFailedToBuild = set()
self.checkForUpdatesExternally = checkForUpdatesExternally
开发者ID:talwrii,项目名称:subuser,代码行数:8,代码来源:installationTask.py
示例4: __init__
def __init__(self,user):
UserOwnedObject.__init__(self,user)
if os.path.exists(self.getUser().getConfig()["locked-subusers-path"]):
with open(self.getUser().getConfig()["locked-subusers-path"],"r") as file:
self._loadSerializedSubusersDict(json.load(file, object_pairs_hook=collections.OrderedDict),locked=True)
if "subusers.json" in self.getUser().getRegistry().getGitRepository().lsFiles(self.getUser().getRegistry().getGitReadHash(),"./"):
serializedUnlockedSubusersDict = json.loads(self.getUser().getRegistry().getGitRepository().show(self.getUser().getRegistry().getGitReadHash(),"subusers.json"), object_pairs_hook=collections.OrderedDict)
self._loadSerializedSubusersDict(serializedUnlockedSubusersDict,locked=False)
开发者ID:xsongx,项目名称:subuser,代码行数:8,代码来源:subusers.py
示例5: __init__
def __init__(self,user):
self.systemRepositories = {} # TODO rename and document these variables
self.userRepositories = {}
UserOwnedObject.__init__(self,user)
self.systemRepositoryListPaths = ["/etc/subuser/repositories.json"
,os.path.join(user.homeDir,".subuser","repositories.json")
,subuserlib.paths.getSubuserDataFile("repositories.json")] # TODO how does this work on windows?
self.userRepositoryListPath = os.path.join(self.getUser().getConfig()["registry-dir"],"repositories.json")
self.reloadRepositoryLists()
开发者ID:pages-alex-alex2006hw,项目名称:subuser,代码行数:9,代码来源:repositories.py
示例6: __init__
def __init__(self,user):
UserOwnedObject.__init__(self,user)
if os.path.exists(self.getUser().getConfig()["locked-subusers-path"]):
with open(self.getUser().getConfig()["locked-subusers-path"],"r") as fileHandle:
self._loadSerializedSubusersDict(json.load(fileHandle, object_pairs_hook=collections.OrderedDict),locked=True)
registryFileStructure = self.getUser().getRegistry().getGitRepository().getFileStructureAtCommit(self.getUser().getRegistry().getGitReadHash())
if self.getUser().getRegistry().initialized and "subusers.json" in registryFileStructure.lsFiles("./"):
serializedUnlockedSubusersDict = json.loads(registryFileStructure.read("subusers.json"), object_pairs_hook=collections.OrderedDict)
self._loadSerializedSubusersDict(serializedUnlockedSubusersDict,locked=False)
开发者ID:talwrii,项目名称:subuser,代码行数:9,代码来源:subusers.py
示例7: __init__
def __init__(self,user,subuser,environment):
self.__subuser = subuser
self.__environment = environment
self.__extraFlags = []
self.__background = False
if not subuserlib.test.testing:
self.__hostname = binascii.b2a_hex(os.urandom(10))
else:
self.__hostname = b"<random-hostname>"
UserOwnedObject.__init__(self,user)
开发者ID:EvgenyBahtin,项目名称:subuser,代码行数:10,代码来源:runtime.py
示例8: __init__
def __init__(self,user,subuser):
self.__subuser = subuser
self.__id = None
UserOwnedObject.__init__(self,user)
try:
self.__id = subuser.getRuntimeCache()["run-ready-image-id"]
except KeyError:
self.__id = self.build()
subuser.getRuntimeCache()["run-ready-image-id"] = self.__id
subuser.getRuntimeCache().save()
开发者ID:xsongx,项目名称:subuser,代码行数:10,代码来源:runReadyImage.py
示例9: __init__
def __init__(self,user):
self.images = {}
self.nextImageId = 1
self.newId = None
UserOwnedObject.__init__(self,user)
self.imagesPath = os.path.join(user.homeDir,"docker/images.json")
self.__load()
self.dockerDaemon = subuserlib.classes.docker.dockerDaemon.RealDockerDaemon(user)
self.connection = MockConnection(self)
self.dockerDaemon.getConnection = self.getConnection
self.dockerDaemon.getImageProperties = self.getImageProperties
开发者ID:awesome-docker,项目名称:subuser,代码行数:11,代码来源:mockDockerDaemon.py
示例10: __init__
def __init__(self,user):
self.images = {}
self.nextImageId = 1
UserOwnedObject.__init__(self,user)
self.imagesPath = "/root/subuser/test/docker/images.json"
if not os.path.exists(self.imagesPath):
self.imagesPath = "/home/travis/build/subuser-security/subuser/test/docker/images.json"
self.__load()
self.dockerDaemon = subuserlib.classes.docker.dockerDaemon.RealDockerDaemon(user)
self.connection = MockConnection(self)
self.dockerDaemon.getConnection = self.getConnection
self.dockerDaemon.getImageProperties = self.getImageProperties
开发者ID:EvgenyBahtin,项目名称:subuser,代码行数:12,代码来源:mockDockerDaemon.py
示例11: __init__
def __init__(self,user,name,gitOriginURI=None,gitCommitHash=None,temporary=False,sourceDir=None):
"""
Repositories can either be managed by git, or simply be normal directories on the user's computer. If ``sourceDir`` is not set to None, then ``gitOriginURI`` is ignored and the repository is assumed to be a simple directory.
"""
self.__name = name
self.__gitOriginURI = gitOriginURI
self.__lastGitCommitHash = gitCommitHash
self.__temporary=temporary
self.__sourceDir=sourceDir
UserOwnedObject.__init__(self,user)
self.__gitRepository = GitRepository(self.getRepoPath())
self.loadProgramSources()
开发者ID:peter1000,项目名称:subuser,代码行数:12,代码来源:repository.py
示例12: __init__
def __init__(self,user,name,imageSource,imageId,executableShortcutInstalled,locked,serviceSubusers):
self.__name = name
self.__imageSource = imageSource
self.__imageId = imageId
self.__executableShortcutInstalled = executableShortcutInstalled
self.__locked = locked
self.__serviceSubusers = serviceSubusers
self.__x11Bridge = None
self.__runReadyImage = None
self.__runtime = None
self.__runtimeCache = None
self.__permissions = None
UserOwnedObject.__init__(self,user)
开发者ID:xsongx,项目名称:subuser,代码行数:13,代码来源:subuser.py
示例13: __init__
def __init__(self,user,name,gitOriginURI=None,gitCommitHash=None,temporary=False,sourceDir=None):
"""
Repositories can either be managed by git, or simply be normal directories on the user's computer. If ``sourceDir`` is not set to None, then ``gitOriginURI`` is ignored and the repository is assumed to be a simple directory.
"""
self.__name = name
self.__gitOriginURI = gitOriginURI
self.__lastGitCommitHash = gitCommitHash
self.__temporary = temporary
self.__sourceDir = sourceDir
self.__fileStructure = None
UserOwnedObject.__init__(self,user)
self.__gitRepository = GitRepository(self.getRepoPath())
if not os.path.exists(self.getRepoPath()):
self.updateSources(initialUpdate=True)
self.__repoConfig = self.loadRepoConfig()
self.loadImageSources()
开发者ID:pages-alex-alex2006hw,项目名称:subuser,代码行数:16,代码来源:repository.py
示例14: __init__
def __init__(self,user,subuser,environment,extraDockerFlags=None):
self.__subuser = subuser
self.__environment = environment
self.__backgroundSuppressOutput = True
self.__backgroundCollectStdout = False
self.__backgroundCollectStderr = False
self.__executionSpoolReader = None
if extraDockerFlags is None:
self.__extraFlags = []
else:
self.__extraFlags = extraDockerFlags
self.__background = False
if not subuserlib.test.testing:
self.__hostname = binascii.b2a_hex(os.urandom(10))
else:
self.__hostname = b"<random-hostname>"
UserOwnedObject.__init__(self,user)
开发者ID:ruipgpinheiro,项目名称:subuser,代码行数:17,代码来源:runtime.py
示例15: __init__
def __init__(self,user,name,imageId,executableShortcutInstalled,locked,serviceSubusers,imageSource=None,imageSourceName=None,repoName=None,entrypointsExposed=False):
self.__name = name
self.__imageSource = imageSource
self.__repoName = repoName
self.__imageSourceName = imageSourceName
self.__imageId = imageId
self.__executableShortcutInstalled = executableShortcutInstalled
self.__entryPointsExposed = entrypointsExposed
self.__entryPointsExposedThisRun = False
self.__locked = locked
self.__serviceSubusers = serviceSubusers
self.__x11Bridge = None
self.__runReadyImage = None
self.__runtime = None
self.__runtimeCache = None
self.__permissions = None
self.__permissionsTemplate = None
UserOwnedObject.__init__(self,user)
开发者ID:KarimJedda,项目名称:subuser,代码行数:18,代码来源:subuser.py
示例16: __init__
def __init__(self,user,subuser,environment,extraDockerFlags=None,entrypoint = None):
self.__subuser = subuser
self.__environment = environment
self.__backgroundSuppressOutput = True
self.__backgroundCollectStdout = False
self.__backgroundCollectStderr = False
self.__executionSpoolReader = None
if extraDockerFlags is None:
self.__extraFlags = []
else:
self.__extraFlags = extraDockerFlags
if not entrypoint:
self.entrypoint = self.getSubuser().getPermissions()["executable"]
else:
self.entrypoint = entrypoint
self.__background = False
if not subuserlib.test.testing:
self.__hostname = binascii.b2a_hex(os.urandom(10)).decode()
else:
self.__hostname = "<random-hostname>"
UserOwnedObject.__init__(self,user)
开发者ID:awesome-docker,项目名称:subuser,代码行数:21,代码来源:runtime.py
示例17: __init__
def __init__(self,user):
UserOwnedObject.__init__(self,user)
self.proxiedByOtherUser = False
try:
self.name = self.getUser().getConfig()["user"]
self.proxiedByOtherUser = True
except KeyError:
try:
self.name = getpass.getuser()
except KeyError:
# We use a broken setup when generating documentation...
self.name = "I have no name!"
self.uid = 1000
self.gid = 1000
if not test.testing:
try:
self.uid = pwd.getpwnam(self.name)[2]
self.gid = pwd.getpwnam(self.name)[3]
except KeyError:
pass
if not self.uid == 0:
self.homeDir = os.path.join("/home/",self.name)
else:
self.homeDir = "/root/"
开发者ID:hankerepo,项目名称:subuser,代码行数:24,代码来源:endUser.py
示例18: __init__
def __init__(self, user, containerId):
self.__containerId = containerId
UserOwnedObject.__init__(self, user)
开发者ID:talwrii,项目名称:subuser,代码行数:3,代码来源:container.py
示例19: __init__
def __init__(self,user):
UserOwnedObject.__init__(self,user)
self.reloadInstalledImagesList()
开发者ID:pages-alex-alex2006hw,项目名称:subuser,代码行数:3,代码来源:installedImages.py
示例20: __init__
def __init__(self,user):
self.__connection = None
self.__imagePropertiesCache = {}
UserOwnedObject.__init__(self,user)
开发者ID:elfchief,项目名称:subuser,代码行数:4,代码来源:dockerDaemon.py
注:本文中的subuserlib.classes.userOwnedObject.UserOwnedObject类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论