Example #1
0
 def make_path(self, path=None):
     """
     Helper method for an OVZFile object to be able to create the path for
     self.filename if it doesn't exist before running touch()
     """
     if not path:
         path = self.filename
     basedir = os.path.dirname(path)
     ovz_utils.make_dir(basedir)
    def untar_instance(self):
        """
        Expand the tarball from the instance and expand it into place
        """
        LOG.debug(_('Untarring instance: %s') % self.instance_tarfile)
        LOG.debug(_('Make sure directory exists: %s') % self.instance_source)
        ovz_utils.make_dir(self.instance_source)

        sed_regex = 's/%(uuid)s/%(ctid)s/' % {
            'ctid': self.container.ovz_id,
            'uuid': self.container.uuid,
        }
        ovz_utils.untar(self.instance_tarfile, self.instance_parent,
                        extra=['--transform', sed_regex])
        LOG.debug(_('Untarred instance: %s') % self.instance_source)
Example #3
0
 def make_dump_dir(self):
     """
     Make our dump locations
     """
     LOG.debug(_('Making dump location for %s') % self.instance['id'])
     ovz_utils.make_dir(self.dumpdir)
     ovz_utils.make_dir(self.i_dumpdir)
     ovz_utils.make_dir(self.q_dumpdir)
     ovz_utils.make_dir(self.as_dumpdir)
     LOG.debug(_('Done making location for %s') % self.instance['id'])
 def make_dump_dir(self):
     """
     Make our dump locations
     """
     LOG.debug(_('Making dump location for %s') % self.container.ovz_id)
     ovz_utils.make_dir(self.dumpdir)
     ovz_utils.make_dir(self.i_dumpdir)
     ovz_utils.make_dir(self.q_dumpdir)
     ovz_utils.make_dir(self.as_dumpdir)
     LOG.debug(_('Done making location for %s') % self.container.ovz_id)