Commit Graph

8 Commits

Author SHA1 Message Date
Sean McGinnis ec54d366a3
Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.

Change-Id: I24daffca6667325bd7710e02e0b6a057935e9ac9
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-18 11:55:15 -05:00
zhurong 84f5778fc5 Remove six usage
Change-Id: Ia6b08e81f8df43e67bed0fbd082d7d7edd178fbc
2020-04-16 04:34:44 -07:00
Cao Xuan Hoang 757d5e609d TrivialFix: Remove cfg import unused
This patch removes cfg import unused in
muranoagent/tests/unit/executors/test_chef.py
muranoagent/tests/unit/executors/test_puppet.py

Change-Id: I046ece0dc5181f81b284fd362a461dfa817ff129
2016-09-09 15:15:03 +03:00
Victor Stinner cdc4bde0b1 Python 3: Fix basic py3 issues
Run the sixer program to catch most common Python 3 issues and make
the code compatible with Python 2 and Python 3.

* Replace it.next() with next(it)
* Replace dict.keys()[0] with list(dict.keys())[0], since
  dict.keys() now returns an dictview on Python 3. Same change
  for dict.values()[0].
* Replace urlparse with six.moves.urllib.parse
* Replace __builtin__ with six.moves.builtins

Blueprint: murano-python-3-support
Change-Id: I9b95c3eee14c2de0010e9a3bbdffdda76496a03c
2016-06-20 21:57:12 +00:00
binean fc918a2619 Fix Mutable defalut argument
Python’s default arguments are evaluated once when the
function is defined, not each time the function is called.
This means that if you use a mutable default argument
and mutate it, you will and have mutated that object for
all future calls to the function as well.

more details about this wrong usage here:
http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments

Change-Id: Ic8eb1328852eb8a3180a08466bf18b72fd1f7956
2016-01-24 23:28:13 +08:00
Kirill Zaitsev dcca26bf26 Drop bunch dependency
Use custom implementation instead

Change-Id: I3c4bc932b60f1c009a0c955867cd2718d1f8ebfc
Closes-Bug: #1519841
2015-11-27 20:23:31 +03:00
Henar Muñoz Frutos 5fc7584583 Puppet default execution involves the definition of none modules.
The Puppet executor has been modified to consider if the recipe is empty.

Closes Bug: #1477482

Change-Id: I23aad503a758e95729b0fb3108049a6652becb32
2015-07-31 13:25:33 +02:00
Henar Muñoz Frutos 42f27a6b6a Support for Configuration Language: Puppet
It allows for Puppet as configuration language in the execution plans.
In addition, it creates a base class (ChefPuppetExecutorBase) for
sharing common methods between Puppet and Chef executors.

Change-Id: I65ae656117aa26fc7dff4f83a2be1b4d2c3cb58b
2015-04-08 16:44:30 +02:00