예제 #1
0
 def driver(self):
     return (
         get_driver_from_expression(
             self.params.driver,
             get_driver,
             Provider,
             self.extra_drivers,
             self.root)
     )
예제 #2
0
파일: static.py 프로젝트: mitchellrj/yaybu
 def _get_source_container(self):
     try:
         return self._get_source_container_from_string()
     except errors.TypeError:
         driver = get_driver_from_expression(
             self.params.source, get_driver, Provider, self.extra_drivers, self.root, ignore=("container", ))
         container = driver.get_container(
             self.params.source.container.as_string())
         return container
예제 #3
0
파일: static.py 프로젝트: mitchellrj/yaybu
 def _get_source_container(self):
     try:
         return self._get_source_container_from_string()
     except errors.TypeError:
         driver = get_driver_from_expression(self.params.source,
                                             get_driver,
                                             Provider,
                                             self.extra_drivers,
                                             self.root,
                                             ignore=("container", ))
         container = driver.get_container(
             self.params.source.container.as_string())
         return container
예제 #4
0
파일: static.py 프로젝트: mitchellrj/yaybu
    def _get_destination_container(self):
        driver = get_driver_from_expression(
            self.params.destination, get_driver, Provider, self.extra_drivers, self.root, ignore=("container", ))

        container_name = self.params.destination.container.as_string()
        changed = False
        try:
            container = driver.get_container(container_name=container_name)
        except ContainerDoesNotExistError:
            if self.root.readonly:
                return True, None
            with self.root.ui.throbber("Create container '%s'" % container_name):
                if self.root.simulate:
                    return True, None
                container = driver.create_container(
                    container_name=container_name)
                changed = True
        return changed, container
예제 #5
0
파일: static.py 프로젝트: mitchellrj/yaybu
    def _get_destination_container(self):
        driver = get_driver_from_expression(self.params.destination,
                                            get_driver,
                                            Provider,
                                            self.extra_drivers,
                                            self.root,
                                            ignore=("container", ))

        container_name = self.params.destination.container.as_string()
        changed = False
        try:
            container = driver.get_container(container_name=container_name)
        except ContainerDoesNotExistError:
            if self.root.readonly:
                return True, None
            with self.root.ui.throbber("Create container '%s'" %
                                       container_name):
                if self.root.simulate:
                    return True, None
                container = driver.create_container(
                    container_name=container_name)
                changed = True
        return changed, container