summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Options/Parser.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix errros with old pylint/pep8Alexander Sulfrian2017-03-291-1/+3
| | | | | | | | | | | | For Python2.4 we need older version of pylint and pep8, that finds some more errors: - On python2.4 _ast is not available and pylint uses compiler.ast, that seems to have some problems with the line numbers if a comment is following the pylint disable marker. - In python2.4 there is no xml.etree. But we can ignore this error because Client.XML tries to find a suitable library. - Some small formatting issues.
* Merge pull request #362 from AlexanderS/fix/missing-config-fileAlexander Sulfrian2017-03-101-1/+1
|\ | | | | Options: Missing config file is not a fatal error
| * Options: Missing config file is not a fatal errorAlexander Sulfrian2016-09-281-1/+1
| | | | | | | | | | If the config file is not available, it should not be a fatal error, but bcfg2 should just use the default config values.
* | Options: Fix default repository pathSol Jerome2016-09-281-1/+1
|/ | | | Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
* Options: Set default values from config, right after adding a new optionAlexander Sulfrian2015-07-221-0/+3
| | | | | | | | | | | | | | | | If adding an option during the "Main Parser Loop" (for example because of loading a component for bcfg-lint) a value for the option from the config file is simply ignored. After adding the option, the parser first tries to find the value in the command line, but cannot find it and set the default value from the source code as option value. After that the value from the config file is set as new default, but because the option already is in the Namespace, it does not use the new "default" value from the config file. This patch simply sets the default value from the config file for the new options, right after adding it to the parser and so the correct value is used afterwards, if the parser cannot find the flag on the command line.
* Bcfg2/Options/Parser: fix --version option, add testAlexander Sulfrian2014-11-251-2/+9
|
* Options: gather as much data from config file firstChris St. Pierre2014-11-101-2/+10
|
* Options: ensure <repository> macros are always fixed upChris St. Pierre2014-11-101-23/+54
| | | | | | | This fixes several cases in which <repository> macros would not be properly processed: options that are not added to the parser yet when early options are parsed; and config file options whose default value is used.
* testsuite: Added unit tests for new option parsingChris St. Pierre2014-11-101-39/+55
|
* Add BCFG2_CONFIG_FILE environment variable (regression from 1.3)Michael Fenn2014-04-071-0/+2
|
* Options: call _set_defaults_from_config before _parse_config_optionsMichael Fenn2014-03-191-0/+18
| | | | | | | | | | | | | | | | | | | | _set_defaults_from_config must be called before _parse_config_options This is due to a tricky interaction between the two methods: (1) _set_defaults_from_config does what its name implies, it updates the "default" property of each Option based on the value that exists in the config. (2) _parse_config_options will look at each option and set it to the default value that is _currently_ defined. If the option does not exist in the namespace, it will be added. The method carefully avoids overwriting the value of an option that is already defined in the namespace. Thus, if _set_defaults_from_config has not been called yet when _parse_config_options is called, all config file options will get set to their hardcoded defaults. This process defines the options in the namespace and _parse_config_options will never look at them again.
* Options: rename _set_defaults to _set_defaults_from_configMichael Fenn2014-03-191-3/+3
| | | | This is to make the method name more in line with what it does
* Options: set config file options only for the running parserChris St. Pierre2014-03-141-5/+4
|
* Options: Finalize actual value, not default valueChris St. Pierre2014-03-051-2/+1
| | | | This also fixes some extraneous calls in the option parsing loop.
* Options: set options debugging with environment variableChris St. Pierre2014-03-051-2/+24
|
* Options: Finalize onceMichael Fenn2013-12-071-1/+1
| | | | | | | | If finalize is called early, then some options will not be parsed but instead always take the default value (observed with reporting.transport). Calling finalize once at the end of the processing lets all options take the values they were assigned in the config file.
* Options: parse config options before setting defaultsChris St. Pierre2013-11-121-0/+1
|
* Options: made unit test flag publicChris St. Pierre2013-11-121-3/+3
|
* Options: added workaround for unit tests that use the parserChris St. Pierre2013-11-121-13/+12
|
* Options: Don't reparse initial config fileChris St. Pierre2013-10-311-3/+5
| | | | It hasn't been parsed at this stage anyway.
* DB: fixed how Django settings are loadedChris St. Pierre2013-10-301-8/+33
|
* Options: parse arg list passed in, not sys.argvChris St. Pierre2013-09-031-1/+1
|
* Options: fixed error message when bcfg2.conf is not readableChris St. Pierre2013-08-161-2/+1
|
* Options: Replace relative imports with absoluteChris St. Pierre2013-08-121-1/+1
|
* testsuite: fixed most pylint complaintsChris St. Pierre2013-08-091-7/+15
|
* Options: reparse all arguments on each passChris St. Pierre2013-08-091-7/+3
| | | | | | | | | This ensures that required positional arguments are handled properly. If we only reparse the remaining arguments -- i.e., those that were not understood on previous passes -- then we may parse out all of the positional arguments on the first pass, and then on a subsequent pass parse_known_args() will fail because the positional argument is not provided.
* Options: fix parsing of ComponentActions and other finalizable actionsChris St. Pierre2013-08-091-4/+4
|
* Options: wrote completely new option parserChris St. Pierre2013-06-271-0/+282