[PATCH] Slave.Job: add missing json keyword when passing argument to
exec_cmd()
by Jan Tluka
The self._what["json"] value is passed as the value of die_on_err argument
(positional-argument-wise), which makes every command running through this
method return with success.
Instead the value should be passed with the keyword, that is
exec_cmd(...json=self._what["json"]).
Fixes issue 196
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/Job.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Slave/Job.py b/lnst/Slave/Job.py
index b4cdac44..1a1755fe 100644
--- a/lnst/Slave/Job.py
+++ b/lnst/Slave/Job.py
@@ -239,7 +239,7 @@ class GenericJob(object):
class ShellExecJob(GenericJob):
def run(self):
try:
- stdout, stderr = exec_cmd(self._what["command"], self._what["json"])
+ stdout, stderr = exec_cmd(self._what["command"], json=self._what["json"])
self._result["passed"] = True
self._result["res_data"] = {"stdout": stdout, "stderr": stderr}
except ExecCmdFail as e:
--
2.21.3
3 years, 6 months
[PATCH v2 0/5] IpsecEspAead, PacketAssert and XfrmTools docs
by jurbanov@redhat.com
From: Jozef Urbanovsky <jurbanov(a)redhat.com>
Hi team,
This patch extends the documentation of IpsecEspAeadRecipe based on
your feedback. Adding new structure and documentation to the docs.
Both PacketAssert modules (RecipeCommon and Tests)
are extended with documentation.
Jozef Urbanovsky (5):
lnst.Recipes.ENRT.IpsecEspAeadRecipe: extend documentation, add mixin
lnst.Recipes.ENRT.XfrmTools: add documentation
lnst.RecipeCommon.PacketAssert: add documentation
lnst.Tests.PacketAssert: add documentation
docs: extend structure and add newly created documentations
docs/source/enrt_recipes.rst | 3 +
docs/source/recipe_PacketAssert.rst | 5 +
docs/source/recipe_common.rst | 7 ++
docs/source/specific_scenarios.rst | 1 +
docs/source/tests.rst | 7 ++
docs/source/tests_PacketAssert.rst | 5 +
docs/source/utils.rst | 5 +
docs/source/xfrm_tools.rst | 5 +
lnst/RecipeCommon/PacketAssert.py | 42 ++++++++
lnst/Recipes/ENRT/IpsecEspAeadRecipe.py | 131 +++++++++++++++++++-----
lnst/Recipes/ENRT/XfrmTools.py | 39 +++++++
lnst/Tests/PacketAssert.py | 23 +++++
12 files changed, 249 insertions(+), 24 deletions(-)
create mode 100644 docs/source/recipe_PacketAssert.rst
create mode 100644 docs/source/recipe_common.rst
create mode 100644 docs/source/tests.rst
create mode 100644 docs/source/tests_PacketAssert.rst
create mode 100644 docs/source/utils.rst
create mode 100644 docs/source/xfrm_tools.rst
--
2.25.4
3 years, 6 months
[PATCH] Machine: fix default value for Machine pool_params
by olichtne@redhat.com
From: Ondrej Lichtner <olichtne(a)redhat.com>
Should be {} instead of None since this is automatically passed to the
_from_dict() method of a Parameters instance. This affects recipes where
we dynamically connect to machines as part of the recipe itself - for
example guest vms created during the recipe.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Controller/Machine.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index f63fd6f..10e0fdc 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -45,7 +45,7 @@ class Machine(object):
"""
def __init__(self, m_id, hostname, msg_dispatcher, ctl_config,
- libvirt_domain=None, rpcport=None, security=None, pool_params=None):
+ libvirt_domain=None, rpcport=None, security=None, pool_params={}):
self._id = m_id
self._hostname = hostname
self._mapped = False
--
2.28.0
3 years, 6 months
[PATCH 0/4] IpsecEspAead, PacketAssert and XfrmTools docs
by jurbanov@redhat.com
From: Jozef Urbanovsky <jurbanov(a)redhat.com>
Hi team,
This patch extends the documentation of IpsecEspAeadRecipe based on
Jan's feedback. Adding forgotten reference to the specific_scenarios.
Both PacketAssert modules (RecipeCommon and Tests)
are extended with documentation.
Jozef Urbanovsky (4):
docs.source.specific_scenarios: add ipsec_esp_aead_recipe
lnst.RecipeCommon.PacketAssert: add documentation
lnst.Recipes.ENRT.XfrmTools: add documentation
lnst.Recipes.ENRT.IpsecEspAeadRecipe: extend and fix documentation
docs/source/specific_scenarios.rst | 1 +
lnst/RecipeCommon/PacketAssert.py | 27 +++++++++++++++++++
lnst/Recipes/ENRT/IpsecEspAeadRecipe.py | 23 +++++++++++-----
lnst/Recipes/ENRT/XfrmTools.py | 36 +++++++++++++++++++++++++
lnst/Tests/PacketAssert.py | 20 ++++++++++++++
5 files changed, 100 insertions(+), 7 deletions(-)
--
2.25.4
3 years, 6 months
[PATCH] docs: add BondRecipe documentation
by aloughla@redhat.com
From: Aniss Loughlam <aloughla(a)redhat.com>
Signed-off-by: Aniss Loughlam <aloughla(a)redhat.com>
---
docs/source/bond_recipe.rst | 6 ++++++
docs/source/specific_scenarios.rst | 1 +
2 files changed, 7 insertions(+)
create mode 100644 docs/source/bond_recipe.rst
diff --git a/docs/source/bond_recipe.rst b/docs/source/bond_recipe.rst
new file mode 100644
index 0000000..921ceaf
--- /dev/null
+++ b/docs/source/bond_recipe.rst
@@ -0,0 +1,6 @@
+BondRecipe
+^^^^^^^^^^^^^^^^^^^
+
+.. autoclass:: lnst.Recipes.ENRT.BondRecipe.BondRecipe
+ :members:
+ :show-inheritance:
diff --git a/docs/source/specific_scenarios.rst b/docs/source/specific_scenarios.rst
index b78577c..ee70313 100644
--- a/docs/source/specific_scenarios.rst
+++ b/docs/source/specific_scenarios.rst
@@ -3,6 +3,7 @@ Specific ENRT scenarios
.. toctree::
simple_network_recipe
+ bond_recipe
team_recipe
vlans_recipe
vlans_over_bond_recipe
--
2.25.4
3 years, 6 months
[PATCH] RecipeResults.py: Stop excluding RemoteDevices from export
by pgagne@redhat.com
From: Perry Gagne <pgagne(a)redhat.com>
Was able to figure out the issues with exporting Devices, so we don't need to exclude them anymore.
Signed-off-by: Perry Gagne <pgagne(a)redhat.com>
---
lnst/Common/ConnectionHandler.py | 7 +++++++
lnst/Controller/Machine.py | 8 ++++++++
lnst/Controller/RecipeResults.py | 5 -----
lnst/Devices/RemoteDevice.py | 2 ++
4 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/lnst/Common/ConnectionHandler.py b/lnst/Common/ConnectionHandler.py
index a74d4a8..04bf7be 100644
--- a/lnst/Common/ConnectionHandler.py
+++ b/lnst/Common/ConnectionHandler.py
@@ -133,3 +133,10 @@ class ConnectionHandler(object):
def clear_connections(self):
self._connections = []
self._connection_mapping = {}
+
+ def __getstate__(self):
+ state = self.__dict__.copy()
+ # Remove things that can't be pickled
+ state['_connections'] = []
+ state['_connection_mapping'] = {}
+ return state
\ No newline at end of file
diff --git a/lnst/Controller/Machine.py b/lnst/Controller/Machine.py
index 4b9afcb..5920d69 100644
--- a/lnst/Controller/Machine.py
+++ b/lnst/Controller/Machine.py
@@ -589,3 +589,11 @@ class Machine(object):
def get_security(self):
return self._security
+
+ def __getstate__(self):
+ state = self.__dict__.copy()
+ # Remove things that can't be pickled
+ state['_msg_dispatcher'] = None
+ if self.get_libvirt_domain():
+ state['_domain_ctl'] = None
+ return state
\ No newline at end of file
diff --git a/lnst/Controller/RecipeResults.py b/lnst/Controller/RecipeResults.py
index 941ea8d..38a4170 100644
--- a/lnst/Controller/RecipeResults.py
+++ b/lnst/Controller/RecipeResults.py
@@ -118,11 +118,6 @@ class DeviceConfigResult(BaseResult):
def device(self):
return self._device
- def __getstate__(self):
- state = self.__dict__.copy()
- # Remove things that can't be pickled
- state['_device'] = None
- return state
class DeviceCreateResult(DeviceConfigResult):
@property
diff --git a/lnst/Devices/RemoteDevice.py b/lnst/Devices/RemoteDevice.py
index f11fa65..7891514 100644
--- a/lnst/Devices/RemoteDevice.py
+++ b/lnst/Devices/RemoteDevice.py
@@ -108,6 +108,8 @@ class RemoteDevice(object):
def __getattr__(self, name):
if name == "_inited":
return False
+ if not self._inited:
+ return super(RemoteDevice, self).__getattr__(name)
attr = getattr(self._dev_cls, name)
--
2.26.2
3 years, 6 months