| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 62e5e8c commit c532db1
19 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -173,14 +173,14 @@ | |||
| 173 | 173 | # -- Options for LaTeX output -------------------------------------------------- | |
| 174 | 174 | ||
| 175 | 175 | latex_elements = { | |
| 176 | - # The paper size ('letterpaper' or 'a4paper'). | ||
| 177 | - # 'papersize': 'letterpaper', | ||
| 176 | + # The paper size ('letterpaper' or 'a4paper'). | ||
| 177 | + # 'papersize': 'letterpaper', | ||
| 178 | 178 | ||
| 179 | - # The font size ('10pt', '11pt' or '12pt'). | ||
| 180 | - # 'pointsize': '10pt', | ||
| 179 | + # The font size ('10pt', '11pt' or '12pt'). | ||
| 180 | + # 'pointsize': '10pt', | ||
| 181 | 181 | ||
| 182 | - # Additional stuff for the LaTeX preamble. | ||
| 183 | - # 'preamble': '', | ||
| 182 | + # Additional stuff for the LaTeX preamble. | ||
| 183 | + # 'preamble': '', | ||
| 184 | 184 | } | |
| 185 | 185 | ||
| 186 | 186 | # Grouping the document tree into LaTeX files. List of tuples | |
@@ -229,8 +229,8 @@ | |||
| 229 | 229 | # dir menu entry, description, category) | |
| 230 | 230 | texinfo_documents = [ | |
| 231 | 231 | ('index', 'packstack', u'packstack Documentation', | |
| 232 | - u'Derek Higgins', 'packstack', 'One line description of project.', | ||
| 233 | - 'Miscellaneous'), | ||
| 232 | + u'Derek Higgins', 'packstack', 'One line description of project.', | ||
| 233 | + 'Miscellaneous'), | ||
| 234 | 234 | ] | |
| 235 | 235 | ||
| 236 | 236 | # Documents to append as an appendix to all manuals. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,8 +52,6 @@ | |||
| 52 | 52 | DIR_PLUGINS = os.path.join(DIR_PROJECT_DIR, "plugins") | |
| 53 | 53 | DIR_MODULES = os.path.join(DIR_PROJECT_DIR, "modules") | |
| 54 | 54 | ||
| 55 | - | ||
| 56 | - | ||
| 57 | 55 | EXEC_RPM = "rpm" | |
| 58 | 56 | EXEC_SEMANAGE = "semanage" | |
| 59 | 57 | EXEC_NSLOOKUP = "nslookup" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,8 +24,8 @@ def _transfer(self, pack_path, pack_dest, res_dir): | |||
| 24 | 24 | script.append("scp %(pack_path)s root@%(node)s:%(pack_dest)s" | |
| 25 | 25 | % args) | |
| 26 | 26 | script.append("ssh -o StrictHostKeyChecking=no " | |
| 27 | - "-o UserKnownHostsFile=/dev/null root@%(node)s " | ||
| 28 | - "tar -C %(res_dir)s -xpzf %(pack_dest)s" % args) | ||
| 27 | + "-o UserKnownHostsFile=/dev/null root@%(node)s " | ||
| 28 | + "tar -C %(res_dir)s -xpzf %(pack_dest)s" % args) | ||
| 29 | 29 | try: | |
| 30 | 30 | script.execute() | |
| 31 | 31 | except ScriptRuntimeError as ex: | |
@@ -124,15 +124,15 @@ def __init__(self, node, resource_dir=None, recipe_dir=None, | |||
| 124 | 124 | # remote host IP or hostname | |
| 125 | 125 | self.node = node | |
| 126 | 126 | # working directories on remote host | |
| 127 | - self.resource_dir = resource_dir or \ | ||
| 128 | - '/tmp/drone%s' % uuid.uuid4().hex[:8] | ||
| 129 | - self.recipe_dir = recipe_dir or \ | ||
| 130 | - os.path.join(self.resource_dir, 'recipes') | ||
| 127 | + self.resource_dir = (resource_dir or | ||
| 128 | + '/tmp/drone%s' % uuid.uuid4().hex[:8]) | ||
| 129 | + self.recipe_dir = (recipe_dir or | ||
| 130 | + os.path.join(self.resource_dir, 'recipes')) | ||
| 131 | 131 | # temporary directories | |
| 132 | - self.remote_tmpdir = remote_tmpdir or \ | ||
| 133 | - '/tmp/drone%s' % uuid.uuid4().hex[:8] | ||
| 134 | - self.local_tmpdir = local_tmpdir or \ | ||
| 135 | - tempfile.mkdtemp(prefix='drone') | ||
| 132 | + self.remote_tmpdir = (remote_tmpdir or | ||
| 133 | + '/tmp/drone%s' % uuid.uuid4().hex[:8]) | ||
| 134 | + self.local_tmpdir = (local_tmpdir or | ||
| 135 | + tempfile.mkdtemp(prefix='drone')) | ||
| 136 | 136 | ||
| 137 | 137 | def init_node(self): | |
| 138 | 138 | """ | |
@@ -335,7 +335,7 @@ def init_node(self): | |||
| 335 | 335 | server = utils.ScriptRunner(self.node) | |
| 336 | 336 | for pkg in ("puppet", "openssh-clients", "tar"): | |
| 337 | 337 | server.append("rpm -q --whatprovides %(pkg)s || " | |
| 338 | - "yum install -y %(pkg)s" % locals()) | ||
| 338 | + "yum install -y %(pkg)s" % locals()) | ||
| 339 | 339 | server.execute() | |
| 340 | 340 | ||
| 341 | 341 | def add_resource(self, path, resource_type=None): | |
@@ -352,8 +352,8 @@ def _finished(self, recipe): | |||
| 352 | 352 | recipe_base.replace(".finished", ".log")) | |
| 353 | 353 | local = utils.ScriptRunner() | |
| 354 | 354 | local.append('scp -o StrictHostKeyChecking=no ' | |
| 355 | - '-o UserKnownHostsFile=/dev/null ' | ||
| 356 | - 'root@%s:%s %s' % (self.node, recipe, log)) | ||
| 355 | + '-o UserKnownHostsFile=/dev/null ' | ||
| 356 | + 'root@%s:%s %s' % (self.node, recipe, log)) | ||
| 357 | 357 | try: | |
| 358 | 358 | # once a remote puppet run has finished, we retrieve | |
| 359 | 359 | # the log file and check it for errors | |
@@ -390,8 +390,8 @@ def _apply(self, recipe): | |||
| 390 | 390 | mdir = self._module_dir | |
| 391 | 391 | server.append( | |
| 392 | 392 | "( flock %(rdir)s/ps.lock " | |
| 393 | - "puppet apply %(loglevel)s --modulepath %(mdir)s " | ||
| 394 | - "%(recipe)s > %(running)s 2>&1 < /dev/null; " | ||
| 393 | + "puppet apply %(loglevel)s --modulepath %(mdir)s " | ||
| 394 | + "%(recipe)s > %(running)s 2>&1 < /dev/null; " | ||
| 395 | 395 | "mv %(running)s %(finished)s ) " | |
| 396 | 396 | "> /dev/null 2>&1 < /dev/null &" % locals()) | |
| 397 | 397 | server.execute() | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,7 +48,6 @@ def run(self, config=None, messages=None): | |||
| 48 | 48 | sys.stdout.flush() | |
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | - | ||
| 52 | 51 | class Sequence(object): | |
| 53 | 52 | """ | |
| 54 | 53 | Wrapper for sequence of setup steps. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,8 +52,8 @@ | |||
| 52 | 52 | ||
| 53 | 53 | WARN_WEAK_PASS = "Warning: Weak Password." | |
| 54 | 54 | WARN_NM_ENABLED = ("Warning: NetworkManager is active on %s. OpenStack " | |
| 55 | - "networking currently does not work on systems that have " | ||
| 56 | - "the Network Manager service enabled.") | ||
| 55 | + "networking currently does not work on systems that have " | ||
| 56 | + "the Network Manager service enabled.") | ||
| 57 | 57 | ||
| 58 | 58 | ERR_PING = "Error: the provided hostname is unreachable" | |
| 59 | 59 | ERR_SSH = "Error: could not connect to the ssh server: %s" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -77,7 +77,7 @@ def _getInputFromUser(param): | |||
| 77 | 77 | else: | |
| 78 | 78 | while loop: | |
| 79 | 79 | # If the value was not supplied by the command line flags | |
| 80 | - if not commandLineValues.has_key(param.CONF_NAME): | ||
| 80 | + if param.CONF_NAME not in commandLineValues: | ||
| 81 | 81 | message = StringIO() | |
| 82 | 82 | message.write(param.PROMPT) | |
| 83 | 83 | ||
@@ -121,11 +121,11 @@ def _getInputFromUser(param): | |||
| 121 | 121 | controller.CONF[param.CONF_NAME] = userInput | |
| 122 | 122 | continue | |
| 123 | 123 | else: | |
| 124 | - if commandLineValues.has_key(param.CONF_NAME): | ||
| 124 | + if param.CONF_NAME in commandLineValues: | ||
| 125 | 125 | del commandLineValues[param.CONF_NAME] | |
| 126 | 126 | else: | |
| 127 | 127 | # Delete value from commandLineValues so that we will prompt the user for input | |
| 128 | - if commandLineValues.has_key(param.CONF_NAME): | ||
| 128 | + if param.CONF_NAME in commandLineValues: | ||
| 129 | 129 | del commandLineValues[param.CONF_NAME] | |
| 130 | 130 | loop = True | |
| 131 | 131 | except KeyboardInterrupt: | |
@@ -144,7 +144,7 @@ def input_param(param): | |||
| 144 | 144 | """ | |
| 145 | 145 | # We need to check if a param needs confirmation, (i.e. ask user twice) | |
| 146 | 146 | # Do not validate if it was given from the command line | |
| 147 | - if (param.NEED_CONFIRM and not commandLineValues.has_key(param.CONF_NAME)): | ||
| 147 | + if param.NEED_CONFIRM and param.CONF_NAME not in commandLineValues: | ||
| 148 | 148 | # create a copy of the param so we can call it twice | |
| 149 | 149 | confirmedParam = copy.deepcopy(param) | |
| 150 | 150 | confirmedParamName = param.CONF_NAME + "_CONFIRMED" | |
@@ -492,9 +492,9 @@ def _handleInteractiveParams(): | |||
| 492 | 492 | # we clear the value of all params in the group | |
| 493 | 493 | # in order to re-input them by the user | |
| 494 | 494 | for param in group.parameters.itervalues(): | |
| 495 | - if controller.CONF.has_key(param.CONF_NAME): | ||
| 495 | + if param.CONF_NAME in controller.CONF: | ||
| 496 | 496 | del controller.CONF[param.CONF_NAME] | |
| 497 | - if commandLineValues.has_key(param.CONF_NAME): | ||
| 497 | + if param.CONF_NAME in commandLineValues: | ||
| 498 | 498 | del commandLineValues[param.CONF_NAME] | |
| 499 | 499 | else: | |
| 500 | 500 | inputLoop = False | |
@@ -529,7 +529,7 @@ def _getConditionValue(matchMember): | |||
| 529 | 529 | elif isinstance(matchMember, types.StringType): | |
| 530 | 530 | # we assume that if we get a string as a member it is the name | |
| 531 | 531 | # of a member of conf_params | |
| 532 | - if not controller.CONF.has_key(matchMember): | ||
| 532 | + if matchMember not in controller.CONF: | ||
| 533 | 533 | param = controller.getParamByName(matchMember) | |
| 534 | 534 | input_param(param) | |
| 535 | 535 | returnValue = controller.CONF[matchMember] | |
@@ -546,7 +546,7 @@ def _displaySummary(): | |||
| 546 | 546 | logging.info("*** User input summary ***") | |
| 547 | 547 | for group in controller.getAllGroups(): | |
| 548 | 548 | for param in group.parameters.itervalues(): | |
| 549 | - if not param.USE_DEFAULT and controller.CONF.has_key(param.CONF_NAME): | ||
| 549 | + if not param.USE_DEFAULT and param.CONF_NAME in controller.CONF: | ||
| 550 | 550 | cmdOption = param.CMD_OPTION | |
| 551 | 551 | l = 30 - len(cmdOption) | |
| 552 | 552 | maskParam = param.MASK_INPUT | |
@@ -564,14 +564,14 @@ def _displaySummary(): | |||
| 564 | 564 | logging.debug("user chose to re-enter the user parameters") | |
| 565 | 565 | for group in controller.getAllGroups(): | |
| 566 | 566 | for param in group.parameters.itervalues(): | |
| 567 | - if controller.CONF.has_key(param.CONF_NAME): | ||
| 567 | + if param.CONF_NAME in controller.CONF: | ||
| 568 | 568 | if not param.MASK_INPUT: | |
| 569 | 569 | param.DEFAULT_VALUE = controller.CONF[param.CONF_NAME] | |
| 570 | 570 | # Remove the string from mask_value_set in order | |
| 571 | 571 | # to remove values that might be over overwritten. | |
| 572 | 572 | removeMaskString(controller.CONF[param.CONF_NAME]) | |
| 573 | 573 | del controller.CONF[param.CONF_NAME] | |
| 574 | - if commandLineValues.has_key(param.CONF_NAME): | ||
| 574 | + if param.CONF_NAME in commandLineValues: | ||
| 575 | 575 | del commandLineValues[param.CONF_NAME] | |
| 576 | 576 | print "" | |
| 577 | 577 | logging.debug("calling handleParams in interactive mode") | |
@@ -602,7 +602,7 @@ def _summaryParamsToLog(): | |||
| 602 | 602 | logging.debug("*** The following params were used as user input:") | |
| 603 | 603 | for group in controller.getAllGroups(): | |
| 604 | 604 | for param in group.parameters.itervalues(): | |
| 605 | - if controller.CONF.has_key(param.CONF_NAME): | ||
| 605 | + if param.CONF_NAME in controller.CONF: | ||
| 606 | 606 | maskedValue = mask(controller.CONF[param.CONF_NAME]) | |
| 607 | 607 | logging.debug("%s: %s" % (param.CMD_OPTION, maskedValue)) | |
| 608 | 608 | ||
@@ -725,7 +725,7 @@ def generateAnswerFile(outputFile, overrides={}): | |||
| 725 | 725 | ||
| 726 | 726 | ||
| 727 | 727 | def single_step_aio_install(options, logFile): | |
| 728 | - """ Installs an All in One host on this host""" | ||
| 728 | + """Installs an All in One host on this host.""" | ||
| 729 | 729 | ||
| 730 | 730 | options.install_hosts = utils.get_localhost_ip() | |
| 731 | 731 | ||
@@ -788,15 +788,15 @@ def initCmdLineParser(): | |||
| 788 | 788 | usage = "usage: %prog [options] [--help]" | |
| 789 | 789 | parser = OptionParser(usage=usage, version="%prog {0} {1}".format(version.release_string(), version.version_string())) | |
| 790 | 790 | parser.add_option("--gen-answer-file", help="Generate a template of an answer file, using this option excludes all other options") | |
| 791 | - parser.add_option("--answer-file", help="Runs the configuration in non-interactive mode, extracting all information from the \ | ||
| 792 | - configuration file. using this option excludes all other options") | ||
| 791 | + parser.add_option("--answer-file", help="Runs the configuration in non-interactive mode, extracting all information from the" | ||
| 792 | + "configuration file. using this option excludes all other options") | ||
| 793 | 793 | parser.add_option("--install-hosts", help="Install on a set of hosts in a single step. The format should be a comma separated list " | |
| 794 | - "of hosts, the first is setup as a controller, and the others are setup as compute nodes." | ||
| 795 | - "if only a single host is supplied then it is setup as an all in one installation. An answerfile " | ||
| 796 | - "will also be generated and should be used if Packstack needs to be run a second time ") | ||
| 794 | + "of hosts, the first is setup as a controller, and the others are setup as compute nodes." | ||
| 795 | + "if only a single host is supplied then it is setup as an all in one installation. An answerfile " | ||
| 796 | + "will also be generated and should be used if Packstack needs to be run a second time ") | ||
| 797 | 797 | parser.add_option("--allinone", action="store_true", help="Shorthand for --install-hosts=<local ipaddr> --novanetwork-pubif=<dev> " | |
| 798 | - "--novacompute-privif=lo --novanetwork-privif=lo --os-swift-install=y --nagios-install=y " | ||
| 799 | - ", this option can be used to install an all in one OpenStack on this host") | ||
| 798 | + "--novacompute-privif=lo --novanetwork-privif=lo --os-swift-install=y --nagios-install=y " | ||
| 799 | + ", this option can be used to install an all in one OpenStack on this host") | ||
| 800 | 800 | ||
| 801 | 801 | parser.add_option("-t", "--timeout", default=300, help="The timeout for puppet Exec calls") | |
| 802 | 802 | parser.add_option("-o", "--options", action="store_true", dest="options", help="Print details on options available in answer file(rst format)") | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -90,8 +90,7 @@ def execute(self, can_fail=True, mask_list=None, log=True): | |||
| 90 | 90 | environ = os.environ | |
| 91 | 91 | environ['LANG'] = 'en_US.UTF8' | |
| 92 | 92 | obj = subprocess.Popen(cmd, stdin=_PIPE, stdout=_PIPE, stderr=_PIPE, | |
| 93 | - close_fds=True, shell=False, | ||
| 94 | - env=environ) | ||
| 93 | + close_fds=True, shell=False, env=environ) | ||
| 95 | 94 | ||
| 96 | 95 | script = "function t(){ exit $? ; } \n trap t ERR \n" + script | |
| 97 | 96 | out, err = obj.communicate(script) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,8 +34,8 @@ | |||
| 34 | 34 | 'NetworkManager is not running' | |
| 35 | 35 | ) | |
| 36 | 36 | re_notice = re.compile(r"notice: .*Notify\[packstack_info\]" | |
| 37 | - "\/message: defined \'message\' as " | ||
| 38 | - "\'(?P<message>.*)\'") | ||
| 37 | + "\/message: defined \'message\' as " | ||
| 38 | + "\'(?P<message>.*)\'") | ||
| 39 | 39 | ||
| 40 | 40 | surrogates = [ | |
| 41 | 41 | # Value in /etc/sysctl.conf cannot be changed | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -310,10 +310,10 @@ def create_redis_manifest(config, messages): | |||
| 310 | 310 | ||
| 311 | 311 | slave_clients = set([config['CONFIG_CONTROLLER_HOST']]).union( | |
| 312 | 312 | split_hosts(config['CONFIG_REDIS_SLAVE_HOSTS'])).union( | |
| 313 | - split_hosts(config['CONFIG_REDIS_SENTINEL_HOSTS'])) | ||
| 313 | + split_hosts(config['CONFIG_REDIS_SENTINEL_HOSTS'])) | ||
| 314 | 314 | config['FIREWALL_REDIS_SLAVE_RULES'] = ( | |
| 315 | - _create_redis_firewall_rules( | ||
| 316 | - slave_clients, config['CONFIG_REDIS_PORT'])) | ||
| 315 | + _create_redis_firewall_rules( | ||
| 316 | + slave_clients, config['CONFIG_REDIS_PORT'])) | ||
| 317 | 317 | ||
| 318 | 318 | manifestdata += createFirewallResources( | |
| 319 | 319 | 'FIREWALL_REDIS_SLAVE_RULES') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -601,7 +601,7 @@ def create_manifests(config, messages): | |||
| 601 | 601 | if use_openvswitch_vxlan(config) or use_openvswitch_gre(config): | |
| 602 | 602 | for n_host in network_hosts: | |
| 603 | 603 | cf_fw_nt_key = ("FIREWALL_NEUTRON_TUNNEL_RULES_%s_%s" | |
| 604 | - % (host, n_host)) | ||
| 604 | + % (host, n_host)) | ||
| 605 | 605 | fw_details = dict() | |
| 606 | 606 | key = "neutron_tunnel_%s_%s" % (host, n_host) | |
| 607 | 607 | fw_details.setdefault(key, {}) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments