Beispiel #1
0
 async def delete_local_configuration_routine(self, name: str):
     """Deletes the local configuration for a container.
     arg name: The name of the container to de-configure.
     """
     plat = get_local_platform_routines()
     user = LocalUserRoutines(plat)
     manager = LocalContainerConfigurationManager(user)
     cont = self.GetItemByName(name)
     manager.DeleteByID(cont.GetID())
Beispiel #2
0
    def validate(self, v: str) -> typing.Tuple[bool, str]:
        plat = get_local_platform_routines()
        user = LocalUserRoutines(plat)

        #check it doesn't already exist
        local_vols = GetAllRegisteredLocalVolumes(user)
        for local_vol in local_vols:
            if local_vol.GetName() == v:
                return False, v
        return True, v
Beispiel #3
0
def get_local_volume_choices(adjectives_filter: typing.List[str]):
    plat = get_local_platform_routines()
    user = LocalUserRoutines(plat)
    all_vols = GetAllRegisteredLocalVolumes(user)
    all_vols.append(GetHomeVolume(user))
    choices = {}
    for vol in all_vols:
        assert isinstance(vol, localvolume)
        should_add = False
        if len(adjectives_filter) == 0:
            should_add = True
        else:
            for adj in adjectives_filter:
                if vol.HasAdjective(adj):
                    should_add = True
        if should_add:
            choices[vol.GetName()] = vol
    return choices
 def _get_fie_pipe_server_client(self, hostname: str, username: str = None):
     plat = get_local_platform_routines()
     user = LocalUserRoutines(plat)
     clnt = fiepipelib.fiepipeserver.client.client(hostname, username, user, False)
     return clnt
Beispiel #5
0
 def GetManager(self) -> LocalContainerManager:
     plat = get_local_platform_routines()
     user = LocalUserRoutines(plat)
     return LocalContainerManager(user)
Beispiel #6
0
 def get_storage_mapper(self) -> localstoragemapper:
     plat = get_local_platform_routines()
     user = LocalUserRoutines(plat)
     return localstoragemapper(user)
Beispiel #7
0
 def GetManager(self) -> GitLabServerManager:
     return GitLabServerManager(
         LocalUserRoutines(get_local_platform_routines()))
Beispiel #8
0
def GetHomeVolume(localUser: LocalUserRoutines):
    return FromParameters(HOME_VOLUME_NAME, localUser.get_home_dir(), [CommonAdjectives.containerrole.WORKING_VOLUME])