Commit Graph

19726 Commits

Author SHA1 Message Date
Pedro Algarvio
c170d1e572 Updated test cases to include environment selection in states using __env__. 2013-11-06 20:04:54 +00:00
Pedro Algarvio
f9fca9b809 Accepting __env__ as a keyword argument is no longer required or aceptable 2013-11-06 20:04:54 +00:00
Pedro Algarvio
80916c6698 Deprecated env as a keyword argument since __env__ is now available within the function's global scope. 2013-11-06 20:04:54 +00:00
Pedro Algarvio
65d42890f2 Deprecated env as a keyword argument since __env__ is now available within the function's global scope. 2013-11-06 20:04:54 +00:00
Pedro Algarvio
294f32ceab Accepting __env__ as a keyword argument is no longer required or aceptable 2013-11-06 20:04:54 +00:00
Pedro Algarvio
79734ef8da Accepting __env__ as a keyword argument is no longer required or aceptable 2013-11-06 20:04:54 +00:00
Pedro Algarvio
a9a0dc319f Accepting __env__ as a keyword argument is no longer required or aceptable 2013-11-06 20:04:54 +00:00
Pedro Algarvio
2a1bb631a1 Accepting __env__ as a keyword argument is no longer required or aceptable 2013-11-06 20:04:54 +00:00
Pedro Algarvio
1d9e744296 Set the proper __env__ as a function global when calling the state function. Fixes #8196.
To achieve this we're making use of python's `with` context managers.
Initially we check if the user is passing `env` from his state definition. If he his, then that's the `env` to use for as long as the state function is being executed. Passing `env` is also being deprecated, the users should use the more meaningful and unique `__env_`.
If the user passed `__env__` in his state definition, that's the `env` to use, or, if no specific environment is being selected on the users state definition, then the default one, `base` is what will be used.

This change makes it so that **any state module function** does not have to accept `__env__` as a keyword argument.
2013-11-06 20:04:53 +00:00
Pedro Algarvio
f4912bc797 Log the env in use. 2013-11-06 20:04:10 +00:00
Pedro Algarvio
0a03ecc6bc Add required state file. 2013-11-06 20:04:10 +00:00
Pedro Algarvio
e334e232d1 Forgot to add the top file. 2013-11-06 20:04:10 +00:00
Pedro Algarvio
ec76b188b1 Correctly trigger the issue reported on #8196. 2013-11-06 20:03:44 +00:00
Pedro Algarvio
2924f1c14a Add a test case to check for proper env selection when passing ?env=foo. Refs #8196. 2013-11-06 20:03:44 +00:00
Pedro Algarvio
511e266f6c Merge pull request #8302 from cachedout/change-log-level-for-acl-user-warning
Don't warn non-acl users about logging.
2013-11-06 11:19:52 -08:00
Mike Place
defed3c959 Don't warn non-acl users about logging.
This should be moved to debug, per @thatch45.
2013-11-06 11:48:46 -07:00
Pedro Algarvio
10091763f7 Merge pull request #8284 from terminalmage/exceptions-fix
Fix improper usage of Salt exception classes
2013-11-06 00:21:42 -08:00
Seth House
98f7fdae86 Merge pull request #8292 from gravyboat/develop
Updated minion.rst with a note on verify env for issue 8281.
2013-11-05 22:09:58 -08:00
Forrest Alvarez
a1b4848dbc Updated minion.rst with a note on verify env for issue 8281. 2013-11-06 05:41:56 +00:00
Seth House
51def00c8f Merge pull request #8290 from terminalmage/issue8279
Fix argument parsing for invalid kwargs
2013-11-05 19:47:59 -08:00
Erik Johnson
a1ba178dad Fix argument parsing for invalid kwargs
Salt's argument parser checks the argspec in order to properly allow
positional arguments to be specified in key=value pairs when functions
are run on the command line. However, if a key=value pair is detected,
and the following case happens:

    A) **kwargs is not supported by the function
    B) The parsed argument name is not in the list of the function's
       positional arguments

Then the key=value pair ends up being passed as a positional argument,
leading to unexpected/unintended behavior.

This commit fixes this behavior by accumulating a list of these invalid
keyword arguments, and raising a SaltInvocationError exception if any
are found.
2013-11-05 21:36:54 -06:00
Joseph Hall
f0803fb7f7 Merge pull request #8286 from holmboe/getent-refresh
Add refresh=False to remaining user.getent
2013-11-05 16:19:13 -08:00
Henrik Holmboe
5362f2d59f Add refresh=False to remaining user.getent
This was present for some, but not all implementations of user.getent.
2013-11-06 00:59:46 +01:00
Joseph Hall
3129146a6f Merge pull request #8285 from cachedout/#7829
Add a hasvalue function to grains module
2013-11-05 14:37:56 -08:00
Mike Place
0d6c74cbd9 Pylint fixes. 2013-11-05 15:35:25 -07:00
Mike Place
41675ece9a grains has_value()
Provide the user the ability in a template to easily see whether or not a particular grain has a value.  Refs #7829.
2013-11-05 15:21:01 -07:00
Erik Johnson
711087b997 Fix improper usage of Salt exception classes
Also fixed some string formatting and use of quoted string instead of
raw strings.
2013-11-05 16:12:09 -06:00
C. R. Oldham
19cc035ee0 Merge pull request #8283 from cro/fix_8216
Fixes #8216. Make sure that if the remote salt-ssh user is root, then files untarred by the shim are owned by root.
2013-11-05 13:28:57 -08:00
C. R. Oldham
1e1b6c8618 Fixes #8216. Make sure that if the remote salt-ssh user is root, then files untarred by the shim are owned by root. 2013-11-05 14:26:51 -07:00
Seth House
72ed0468a4 Added explanation and example of updating formula map via Pillar
Refs #8239
2013-11-05 10:13:06 -08:00
Colton Myers
49443466e6 Merge pull request #8260 from terminalmage/issue8247
Add note to pkgrepo states when run with test=True
2013-11-05 10:00:22 -08:00
Mike Place
78062da166 Merge pull request #8269 from vhgroup/develop
Minor fix and documentation
2013-11-05 08:53:58 -08:00
Mike Place
05b8d3d50c Merge pull request #8274 from slav0nic/patch-1
fix grammar in salt.renderers.jinja.rst
2013-11-05 08:30:03 -08:00
Sergey
2da8e454e7 fix grammar in salt.renderers.jinja.rst 2013-11-05 18:28:21 +02:00
Pedro Algarvio
96ef8f7522 Remove stray print 2013-11-05 15:15:39 +00:00
Joseph Hall
53d6080ee5 Merge pull request #8268 from s0undt3ch/develop
Correctly detect a git checkout. Refs #8090. Fixes #8266.
2013-11-05 04:12:18 -08:00
Pedro Algarvio
783d0fdcf1 Correctly detect a git checkout. Refs #8090. Fixes #8266.
The problem is that when we `exec()` the version code from `setup.py`, the `__file__` paths changed and we were "missing" the `.git` directory.
2013-11-05 11:27:06 +00:00
Joseph Hall
ae5cbfd0dc Merge pull request #8265 from s0undt3ch/develop
Stop the `__virtualname__` deprecation warning. Fixes #8221.
2013-11-05 03:15:28 -08:00
Seth House
0683224e10 Added an explanation of grains.filter_by and the merge kwarg to formula
Fixes #8239
2013-11-04 23:23:13 -08:00
Seth House
82c1f392e1 Updated Dash URL for https 2013-11-04 22:50:01 -08:00
Joseph Hall
f2c2c13d04 Merge pull request #8255 from aboe76/develop
updated salt spec file for 0.17.1
2013-11-04 16:47:43 -08:00
Joseph Hall
e93faae1b6 Merge pull request #8256 from cachedout/sys-shutdown
Modify system shutdown command.
2013-11-04 16:45:03 -08:00
Erik Johnson
0a1906d449 Add note to pkgrepo states when run with test=True 2013-11-04 18:06:12 -06:00
Pedro Algarvio
4a924618af Merge pull request #8258 from terminalmage/issue8205
Fix --output-file CLI argument
2013-11-04 15:57:35 -08:00
Erik Johnson
f06a49eed7 Remove existing output file if present
This saves the use of a filehandle by simply removing the file instead
of truncating it. when salt.output.display_output comes along to append
to the file, it will be created if it does not already exist.
2013-11-04 17:55:28 -06:00
Pedro Algarvio
1d35d49288 Stop the __virtualname__ deprecation warning. Fixes #8221. 2013-11-04 23:47:02 +00:00
Erik Johnson
4818d335eb Fix --output-file CLI argument
This commit fixes it so that the file in not overwritten each time a
minion returns information. Fixes #8205.
2013-11-04 17:46:36 -06:00
Niels Abspoel
47b6a803e2 updated salt spec file for 0.17.1
disabled unit testing until next version broken with salt-testing 0.5.2
2013-11-04 22:55:08 +01:00
Colton Myers
f4d8045419 Merge pull request #8246 from multani/fix/8094-ls-remote-use-ssh-key
State git.latest's "ls-remote" step uses the specified SSH key
2013-11-04 10:55:52 -08:00
Joseph Hall
6540c4bc99 Merge pull request #8244 from scottp-dpaw/develop
Minor compatibility fixes for bootstrap_psexec
2013-11-04 03:52:02 -08:00