Commit graph

72 commits

Author SHA1 Message Date
MKLeb
00532e95be bring back the minionswarm script 2022-09-01 07:01:31 -06:00
MKLeb
037b4c2f0d remove test pki fixture and delete old 2022-07-22 10:26:59 -06:00
Pedro Algarvio
76e50885b0 Fix strings 2021-08-06 13:09:47 -07:00
Pedro Algarvio
6abb43d2df Upgrade to black 21.7b0 2021-08-06 13:09:47 -07:00
Daniel A. Wozniak
d9b50659b2 Pyupgrade and drop six 2021-07-06 09:04:28 -04:00
Blacken Salt
0b2a5613b3
Blacken salt 2020-04-03 13:05:41 -05:00
Pedro Algarvio
b0fb204830
Remove useless __init__. Fixes PyLint useless-super-delegation 2020-01-03 12:57:51 +00:00
Pedro Algarvio
8b181159b9
Fix circular imports issue 2019-12-03 15:22:34 +00:00
rallytime
4a218142a5
Remove support for RAET
Conflicts:
* doc/topics/releases/neon.rst
* requirements/tests.txt
* salt/cli/caller.py
* salt/daemons/test/__init__.py
* salt/daemons/test/test_minion.py
* salt/daemons/test/test_saltkeep.py
* salt/modules/event.py
* salt/modules/raet_publish.py
* salt/transport/__init__.py
* salt/utils/parsers.py
* setup.py
* tests/unit/modules/test_raet_publish.py
2019-10-10 09:46:39 +01:00
Gareth J. Greenaway
45f363b152
Fixing various lint errors. 2018-12-20 16:19:01 -08:00
rallytime
3d2ea16c3a
Merge branch '2017.7' into '2018.3'
Conflicts:
  - requirements/base.txt
  - salt/states/archive.py
  - salt/states/file.py
  - tests/integration/runners/test_state.py
  - tests/unit/daemons/test_masterapi.py
2018-06-11 11:45:37 -04:00
Daniel A Wozniak
5027c7bb84
minionswarm runs on windows 2018-06-06 14:19:16 -07:00
Erik Johnson
002aa88a97
Replace yaml usage with a helper to ensure unicode is handled properly
Without allow_unicode=True, unicode characters are processed through the
str representer and on Python 2 are dumped as a Unicode code point (i.e.
a literal \u0414). This commit makes allow_unicode=True the default in
our salt.utils.yamlloader.safe_dump() helper. It also adds a new
salt.utils.yamlloader.dump() helper which wraps yaml.dump() and also
makes allow_unicode=True the default.

To make importing and using our custom yaml loader/dumper easier, a
convenience module called salt.utils.yaml has been added, which does a
wildcard import from both salt.utils.yamldumper and
salt.utils.yamlloader.

Refs to yaml.load/dump and yaml.safe_load/safe_dump have been updated to
salt.utils.yaml, to ensure that unicode is handled properly.
2018-01-03 14:14:21 -06:00
Erik Johnson
8a7d56369c
Use with blocks (or try/finally) to ensure filehandles are closed
This fixes a few sources (or potential sources) of filehandle leaks.
2017-11-09 15:05:40 -06:00
Erik Johnson
3184168365 Use explicit unicode strings + break up salt.utils
This PR is part of what will be an ongoing effort to use explicit
unicode strings in Salt. Because Python 3 does not suport Python 2's raw
unicode string syntax (i.e. `ur'\d+'`), we must use
`salt.utils.locales.sdecode()` to ensure that the raw string is unicode.
However, because of how `salt/utils/__init__.py` has evolved into the
hulking monstrosity it is today, this means importing a large module in
places where it is not needed, which could negatively impact
performance. For this reason, this PR also breaks out some of the
functions from `salt/utils/__init__.py` into new/existing modules under
`salt/utils/`. The long term goal will be that the modules within this
directory do not depend on importing `salt.utils`.

A summary of the changes in this PR is as follows:

* Moves the following functions from `salt.utils` to new locations
  (including a deprecation warning if invoked from `salt.utils`):
  `to_bytes`, `to_str`, `to_unicode`, `str_to_num`, `is_quoted`,
  `dequote`, `is_hex`, `is_bin_str`, `rand_string`,
  `contains_whitespace`, `clean_kwargs`, `invalid_kwargs`, `which`,
  `which_bin`, `path_join`, `shlex_split`, `rand_str`, `is_windows`,
  `is_proxy`, `is_linux`, `is_darwin`, `is_sunos`, `is_smartos`,
  `is_smartos_globalzone`, `is_smartos_zone`, `is_freebsd`, `is_netbsd`,
  `is_openbsd`, `is_aix`
* Moves the functions already deprecated by @rallytime to the bottom of
  `salt/utils/__init__.py` for better organization, so we can keep the
  deprecated ones separate from the ones yet to be deprecated as we
  continue to break up `salt.utils`
* Updates `salt/*.py` and all files under `salt/client/` to use explicit
  unicode string literals.
* Gets rid of implicit imports of `salt.utils` (e.g. `from salt.utils
  import foo` becomes `import salt.utils.foo as foo`).
* Renames the `test.rand_str` function to `test.random_hash` to more
  accurately reflect what it does
* Modifies `salt.utils.stringutils.random()` (née `salt.utils.rand_string()`)
  such that it returns a string matching the passed size. Previously
  this function would get `size` bytes from `os.urandom()`,
  base64-encode it, and return the result, which would in most cases not
  be equal to the passed size.
2017-08-08 13:33:43 -05:00
Pedro Algarvio
61003bca0a
Take care of resource leakage on tests 2017-04-04 18:58:20 +01:00
Silvio Moioli
83c93d1268
minionswarm.py: allow random UUID 2017-03-10 12:10:21 +01:00
Silvio Moioli
573d6e9dfb minionswarm.py: add flag to delay starts 2017-03-04 14:52:18 +01:00
Mike Place
984e6de244 Merge pull request #39024 from moio/minionswarm-set-machine-id
minionswarm.py: allow random machine id
2017-01-30 09:31:15 -07:00
Mike Place
80e4aa2ea2 Merge pull request #39022 from moio/minionswarm-reuse-existing-data
minionswarm.py: allow temporary data reuse
2017-01-30 09:29:30 -07:00
Silvio Moioli
f454dbd84c minionswarm.py: use predictable random numbers 2017-01-30 16:34:01 +01:00
Silvio Moioli
f27e0e8f4e minionswarm.py: allow random machine id 2017-01-30 14:21:52 +01:00
Silvio Moioli
382cf21b5f minionswarm.py: allow re-use of temporary files 2017-01-30 13:23:45 +01:00
Silvio Moioli
b2f7d3e3cf minionswarm.py: add option to specify temp dir 2017-01-30 13:23:45 +01:00
Seth House
ca61237de7 Ensure 'data' remains a dictionary if conf file is empty or missing 2016-07-26 12:41:42 -06:00
Dmitry Kuzmenko
88e8106b00 Handle -c option in minionswarm script.
There is a '-c' option that says: pass in an alt. conf. dir.
But this option isn't used in the minionswarm. I found it very useful to
use it to specify a path to the base salt configuration that would be
updated with the minionswarm specific needs (different ports, paths
etc.) keeping other parameters like alive intervals, timeouts, mine
options and so on.
2016-03-21 16:13:43 +03:00
Thomas S Hatch
d37afd1be8 Add rand-ver option 2015-09-23 16:09:23 -06:00
Thomas S Hatch
d5c23bdf8a Allow the minion swarm to generate random minion OSES 2015-09-23 15:59:55 -06:00
Mike Place
d0eda05f4d Fix bug preventing minionswarm from working with tcp transport 2015-04-30 12:49:16 -06:00
Pedro Algarvio
56840f9a08 Py3 compatibility fixes 2015-01-30 22:25:08 +00:00
Pedro Algarvio
60f215f191 Add from __future__ import absolute_import 2015-01-30 22:25:04 +00:00
Nitin Madhok
c992f04f32 Changing permissions of test files and fixing lint violations 2014-12-19 05:50:18 -05:00
Mike Place
951a434228 +x for eventlisten and minionswarm 2014-11-05 14:49:32 -07:00
Thomas S Hatch
da8612ddcc Merge pull request #14243 from cachedout/masterswarm
Refactor into base swarm and master/minion swarm
2014-07-15 12:22:46 -06:00
Mike Place
200ef6b642 Refactor into base swarm and master/minion swarm 2014-07-15 11:31:07 -06:00
Pedro Algarvio
850e38d9eb Ignore W0221 2014-07-15 01:44:03 +01:00
Mike Place
83ce730ec2 Basic master support for minionswarm 2014-07-14 16:59:44 -06:00
Thomas S Hatch
4551c46abb Give minions a unique pki dir in raet minion swarm 2014-06-26 12:19:31 -06:00
Thomas S Hatch
ecc9b33859 iraet swarm needs ports 2014-06-26 11:35:12 -06:00
Thomas S Hatch
e20da9feca Add sock_dir to raet swarming 2014-06-26 11:04:11 -06:00
Thomas S Hatch
d8efa82b15 initial commit for minion swarm to work with raet
This skips the single keygen that zeromq transport uses because
1. Key gen is not exposed to salt-key yet for raet
2. raet keys are super fast, so I don't think this will be an issue,
but testing on a grander scale will tell us for sure
2014-06-22 22:40:40 -06:00
Seth House
b336c48b8c Pass the minionswarm user through to salt-key
Otherwise salt-key would fail with a user warning and not write the key
which would then cause the minionswarm to fail when referencing the key.
2014-02-06 10:59:34 -07:00
Seth House
d779354351 Moved grabbing/overriding the minionswarm user to parse-time
This change provides a single source of truth for what user the swam
will be running as.
2014-02-06 10:59:34 -07:00
Pedro Algarvio
69d0f907f9 Make use of the print() function. 2014-02-03 11:07:43 +00:00
Arthur Lutz
0cad68c59d add user options to salt-key and to tests/minionswarm.py so one can run in userland 2014-01-23 12:44:14 +01:00
Pedro Algarvio
d02a2bc224 Include the python encoding file header on tests. 2013-11-27 11:19:24 +00:00
Henrik Holmboe
4a48dc791b Prettify subcommand to kill minions
I realize that this is just cosmetic change. And possibly that there is
a compatibility issue, if minionswarm is to be used on platforms that
don't have pkill.
2013-10-11 10:02:23 +02:00
Seth House
08127614f9 Updated arg to salt-key in minionswarm script 2013-07-01 17:03:39 -06:00
Chris Rebert
c7ff123a0f use genexpr & list comp in minionswarm test 2013-05-03 19:45:19 -07:00
Chris Rebert
498d2999db more typo fixes 2013-05-01 16:52:52 -07:00