def _create_nodes(self): for i in range(1, 5): self.tracewriter.dirs_made(sh.mkdirslist(sh.joinpths(self.fs_dev, '%d/node' % i))) link_tgt = sh.joinpths(self.datadir, str(i)) sh.symlink(sh.joinpths(self.fs_dev, str(i)), link_tgt) self.tracewriter.symlink_made(link_tgt) start_port = (6010 + (i - 1) * 5) self._create_node_config(i, start_port) self._delete_templates()
def _create_nodes(self): for i in range(1, 5): self.tracewriter.dirs_made( sh.mkdirslist(sh.joinpths(self.fs_dev, '%d/node' % i))) link_tgt = sh.joinpths(self.datadir, str(i)) sh.symlink(sh.joinpths(self.fs_dev, str(i)), link_tgt) self.tracewriter.symlink_made(link_tgt) start_port = (6010 + (i - 1) * 5) self._create_node_config(i, start_port) self._delete_templates()
def _install_rhel_relinks(self, pkgname, pkginfo): full_pkg_name = self._format_pkg_name(pkgname, pkginfo.get("version")) install_cmd = YUM_CMD + YUM_INSTALL + [full_pkg_name] self._execute_yum(install_cmd) tgt = RHEL_RELINKS.get(pkgname).get("tgt") src = RHEL_RELINKS.get(pkgname).get("src") if not sh.islink(tgt): # This is actually a feature, EPEL must not conflict with RHEL, so X pkg installs newer version in parallel. # # This of course doesn't work when running from git like devstack does.... sh.symlink(src, tgt) return True
def install(self, pkg): yum.YumPackager.install(self, pkg) options = pkg.get('packager_options', {}) links = options.get('links', []) for src, tgt in links: if not sh.islink(tgt): # This is actually a feature, EPEL must not conflict # with RHEL, so X pkg installs newer version in # parallel. # # This of course doesn't work when running from git # like devstack does.... sh.symlink(src, tgt) return True
def _install_special(self, name, info): if name in RHEL_RELINKS: full_pkg_name = self._format_pkg_name(name, info.get("version")) install_cmd = yum.YUM_INSTALL + [full_pkg_name] self._execute_yum(install_cmd) (src, tgt) = RHEL_RELINKS.get(name) if not sh.islink(tgt): # This is actually a feature, EPEL must not conflict with RHEL, so X pkg installs newer version in parallel. # # This of course doesn't work when running from git like devstack does.... sh.symlink(src, tgt) return True else: return False
def install(self, pkg): yum.YumPackager.install(self, pkg) options = pkg.get("packager_options", {}) links = options.get("links", []) for src, tgt in links: if not sh.islink(tgt): # This is actually a feature, EPEL must not conflict # with RHEL, so X pkg installs newer version in # parallel. # # This of course doesn't work when running from git # like devstack does.... sh.symlink(src, tgt) return True
def _configure_symlinks(self): links = self._get_symlinks() link_srcs = sorted(links.keys()) link_srcs.reverse() for source in link_srcs: link = links.get(source) try: LOG.info("Symlinking %s => %s" % (link, source)) self.tracewriter.dirs_made(*sh.symlink(source, link)) self.tracewriter.symlink_made(link) except OSError: LOG.warn("Symlink %s => %s already exists." % (link, source)) return len(links)
def _configure_symlinks(self): links = self._get_symlinks() # This sort happens so that we link in the correct order # although it might not matter. Either way. We ensure that the right # order happens. Ie /etc/blah link runs before /etc/blah/blah link_srcs = sorted(links.keys()) link_srcs.reverse() for source in link_srcs: link = links.get(source) try: LOG.info("Symlinking %r => %r", link, source) self.tracewriter.dirs_made(*sh.symlink(source, link)) self.tracewriter.symlink_made(link) except OSError as e: LOG.warn("Symlink (%r => %r) error (%s)", link, source, e) return len(links)
def _configure_symlinks(self): links = self._get_symlinks() # This sort happens so that we link in the correct order # although it might not matter. Either way. We ensure that the right # order happens. Ie /etc/blah link runs before /etc/blah/blah link_srcs = sorted(links.keys()) link_srcs.reverse() for source in link_srcs: link = links.get(source) try: LOG.info("Symlinking %s => %s", link, source) self.tracewriter.dirs_made(*sh.symlink(source, link)) self.tracewriter.symlink_made(link) except OSError as e: LOG.warn("Symlink (%s => %s) error (%s)", link, source, e) return len(links)
def _create_log_dirs(self): self.tracewriter.dirs_made(*sh.mkdirslist(sh.joinpths(self.logdir, 'hourly'))) sh.symlink(sh.joinpths(self.cfg_dir, SYSLOG_CONF), SWIFT_RSYNC_LOC) self.tracewriter.symlink_made(SWIFT_RSYNC_LOC)
def _turn_on_rsync(self): sh.symlink(sh.joinpths(self.cfg_dir, RSYNC_CONF), RSYNCD_CONF_LOC) self.tracewriter.symlink_made(RSYNCD_CONF_LOC) sh.replace_in(RSYNC_CONF_LOC, RSYNC_ON_OFF_RE, 'RSYNC_ENABLE=true', True)
def _create_log_dirs(self): self.tracewriter.dirs_made( *sh.mkdirslist(sh.joinpths(self.logdir, 'hourly'))) sh.symlink(sh.joinpths(self.cfg_dir, SYSLOG_CONF), SWIFT_RSYNC_LOC) self.tracewriter.symlink_made(SWIFT_RSYNC_LOC)
def symlink(self, source, link): self._start() sh.symlink(source, link) self.tracer.trace(SYMLINK_MAKE, link)
def symlink(self, source, link): self._start() dirs = sh.symlink(source, link) self.dir_made(*dirs) self.tracer.trace(SYMLINK_MAKE, link)