(self, imagerepo, tag, container_id)
Create the directory structure for a container
Create the directory structure for a container
Create the directory structure for a container
def setup_container(self, imagerepo, tag, container_id):
        """Create the directory structure for a container"""
        container_dir = self.containersdir + "/" + str(container_id)
        if os.path.exists(container_dir):
            return ""
        try:
            os.makedirs(container_dir + "/ROOT")
            out_imagerepo = open(container_dir + "/imagerepo.name", 'w')
        except (IOError, OSError):
            return None
        else:
            out_imagerepo.write(imagerepo + ":" + tag)
            out_imagerepo.close()
            self.cur_containerdir = container_dir
            return container_dir
def setup_container ( self , imagerepo , tag , container_id ) : container_dir = self . containersdir + "/" + str ( container_id ) if os . path . exists ( container_dir ) : return "" try : os . makedirs ( container_dir + "/ROOT" ) out_imagerepo = open ( container_dir + "/imagerepo.name" , 'w' ) except ( IOError , OSError ) : return None else : out_imagerepo . write ( imagerepo + ":" + tag ) out_imagerepo . close ( ) self . cur_containerdir = container_dir return container_dir