示例#1
0
 def _create_log_dirs(self):
     data_dir = sh.joinpths(self.get_option("app_dir"), self.cfg.getdefaulted("swift", "data_location", "data"))
     cfg_dir = self.get_option("cfg_dir")
     log_dir = sh.joinpths(data_dir, LOG_DIR)
     self.tracewriter.dirs_made(*sh.mkdirslist(sh.joinpths(log_dir, "hourly")))
     sh.symlink(sh.joinpths(cfg_dir, SYSLOG_CONF), SWIFT_RSYNC_LOC)
     self.tracewriter.symlink_made(SWIFT_RSYNC_LOC)
示例#2
0
 def _configure_symlinks(self):
     links = self.symlinks
     if not links:
         return 0
     # 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()
     link_nice = []
     for source in link_srcs:
         links_to_be = links[source]
         for link in links_to_be:
             link_nice.append("%s => %s" % (link, source))
     utils.log_iterable(link_nice, logger=LOG, header="Creating %s sym-links" % (len(link_nice)))
     links_made = 0
     for source in link_srcs:
         links_to_be = links[source]
         for link in links_to_be:
             try:
                 LOG.debug("Symlinking %s to %s.", link, source)
                 sh.symlink(source, link, tracewriter=self.tracewriter)
                 links_made += 1
             except (IOError, OSError) as e:
                 LOG.warn("Symlinking %s to %s failed: %s", colorizer.quote(link), colorizer.quote(source), e)
     return links_made
示例#3
0
 def _configure_symlinks(self):
     links = self.symlinks
     if not links:
         return 0
     # 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()
     link_nice = []
     for source in link_srcs:
         links_to_be = links[source]
         for link in links_to_be:
             link_nice.append("%s => %s" % (link, source))
     utils.log_iterable(link_nice, logger=LOG,
                        header="Creating %s sym-links" % (len(link_nice)))
     links_made = 0
     for source in link_srcs:
         links_to_be = links[source]
         for link in links_to_be:
             try:
                 LOG.debug("Symlinking %s to %s.", link, source)
                 sh.symlink(source, link, tracewriter=self.tracewriter)
                 links_made += 1
             except (IOError, OSError) as e:
                 LOG.warn("Symlinking %s to %s failed: %s", colorizer.quote(link), colorizer.quote(source), e)
     return links_made
示例#4
0
 def _create_nodes(self):
     data_dir = sh.joinpths(self.get_option("app_dir"), self.cfg.getdefaulted("swift", "data_location", "data"))
     fs_dev = sh.joinpths(data_dir, DEVICE_PATH)
     for i in range(1, 5):
         self.tracewriter.dirs_made(sh.mkdirslist(sh.joinpths(fs_dev, "%d/node" % i)))
         link_tgt = sh.joinpths(data_dir, str(i))
         sh.symlink(sh.joinpths(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()
示例#5
0
 def _fix_virt(self):
     virt_driver = nhelper.canon_virt_driver(self.get_option("virt_driver"))
     if virt_driver == "libvirt":
         virt_type = lv.canon_libvirt_type(self.get_option("libvirt_type"))
         if virt_type == "qemu":
             # On RHEL it appears a sym-link needs to be created
             # to enable qemu to actually work, apparently fixed
             # in RHEL 6.4.
             #
             # See: http://fedoraproject.org/wiki/Getting_started_with_OpenStack_EPEL
             if not sh.isfile("/usr/bin/qemu-system-x86_64"):
                 sh.symlink("/usr/libexec/qemu-kvm", "/usr/bin/qemu-system-x86_64", tracewriter=self.tracewriter)
示例#6
0
文件: nova.py 项目: pombredanne/anvil
 def _fix_virt(self):
     virt_driver = utils.canon_virt_driver(self.get_option('virt_driver'))
     if virt_driver == 'libvirt':
         virt_type = lv.canon_libvirt_type(self.get_option('libvirt_type'))
         if virt_type == 'qemu':
             # On RHEL it appears a sym-link needs to be created
             # to enable qemu to actually work, apparently fixed
             # in RHEL 6.4.
             #
             # See: http://fedoraproject.org/wiki/Getting_started_with_OpenStack_EPEL
             if not sh.isfile('/usr/bin/qemu-system-x86_64'):
                 sh.symlink('/usr/libexec/qemu-kvm', '/usr/bin/qemu-system-x86_64',
                            tracewriter=self.tracewriter)
示例#7
0
 def _fix_virt(self):
     virt_driver = utils.canon_virt_driver(self.get_option('virt_driver'))
     if virt_driver == 'libvirt':
         virt_type = lv.canon_libvirt_type(self.get_option('libvirt_type'))
         if virt_type == 'qemu':
             # On RHEL it appears a sym-link needs to be created
             # to enable qemu to actually work, apparently fixed
             # in RHEL 6.4.
             #
             # See: http://fedoraproject.org/wiki/Getting_started_with_OpenStack_EPEL
             if not sh.isfile('/usr/bin/qemu-system-x86_64'):
                 sh.symlink('/usr/libexec/qemu-kvm',
                            '/usr/bin/qemu-system-x86_64',
                            tracewriter=self.tracewriter)
 def _install(self, pkg):
     yum.YumPackager._install(self, pkg)
     options = pkg.get('packager_options', {})
     links = options.get('links', [])
     for entry in links:
         src = entry['source']
         tgt = entry['target']
         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 anvil does....
             sh.symlink(src, tgt)
     return True
示例#9
0
 def _install(self, pkg):
     yum.YumPackager._install(self, pkg)
     options = pkg.get('packager_options') or {}
     links = options.get('links') or []
     for entry in links:
         tgt = entry.get('target')
         src = entry.get('source')
         if not tgt or not src:
             continue
         src = glob.glob(src)
         if not isinstance(tgt, (list, tuple)):
             tgt = [tgt]
         if len(src) != len(tgt):
             raise RuntimeError("Unable to link %s sources to %s locations" % (len(src), len(tgt)))
         for i in range(len(src)):
             i_src = src[i]
             i_tgt = tgt[i]
             if not sh.islink(i_tgt):
                 sh.symlink(i_src, i_tgt)
 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()
     links_made = 0
     for source in link_srcs:
         link = links.get(source)
         try:
             LOG.info("Symlinking %s to %s.", colorizer.quote(link), colorizer.quote(source))
             self.tracewriter.dirs_made(*sh.symlink(source, link))
             self.tracewriter.symlink_made(link)
             links_made += 1
         except OSError as e:
             LOG.warn("Symlinking %s to %s failed: %s", colorizer.quote(link), colorizer.quote(source), e)
     return links_made
示例#11
0
 def _turn_on_rsync(self):
     sh.symlink(sh.joinpths(self.get_option("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)
示例#12
0
文件: neutron.py 项目: hshah19/anvil
 def create_symlink_to_conf_file(self):
     sh.symlink(self.configurator.path_to_plugin_config,
                "/etc/neutron/plugin.ini",
                force=True)
示例#13
0
 def create_symlink_to_conf_file(self):
     sh.symlink(self.configurator.get_path_to_plugin_config,
                "/etc/quantum/plugin.ini",
                force=True)
示例#14
0
 def create_symlink_to_conf_file(self):
     sh.symlink(self.configurator.path_to_plugin_config,
                "/etc/neutron/plugin.ini",
                force=True)