diff mbox

[KVM-AUTOTEST] kvm_runtest_2.py: use environment filename specified by the 'env' parameter

Message ID 626078156e56b4fd573de078b2f1424e47e8f637.1243179847.git.mgoldish@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michael Goldish May 24, 2009, 3:46 p.m. UTC
Do not use hardcoded environment filename 'env'. Instead use the value
specified by the 'env' parameter. If unspecified, use 'env' as the filename.

This is important for parallel execution; it may be necessary to use a separate
environment file for each process.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm_runtest_2/kvm_runtest_2.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

sudhir kumar May 24, 2009, 7:03 p.m. UTC | #1
good one to be in.  thanks

On Sun, May 24, 2009 at 9:16 PM, Michael Goldish <mgoldish@redhat.com> wrote:
> Do not use hardcoded environment filename 'env'. Instead use the value
> specified by the 'env' parameter. If unspecified, use 'env' as the filename.
>
> This is important for parallel execution; it may be necessary to use a separate
> environment file for each process.
>
> Signed-off-by: Michael Goldish <mgoldish@redhat.com>
> ---
>  client/tests/kvm_runtest_2/kvm_runtest_2.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/client/tests/kvm_runtest_2/kvm_runtest_2.py b/client/tests/kvm_runtest_2/kvm_runtest_2.py
> index fda7282..a69951b 100644
> --- a/client/tests/kvm_runtest_2/kvm_runtest_2.py
> +++ b/client/tests/kvm_runtest_2/kvm_runtest_2.py
> @@ -64,7 +64,7 @@ class kvm_runtest_2(test.test):
>             self.write_test_keyval({key: params[key]})
>
>         # Open the environment file
> -        env_filename = os.path.join(self.bindir, "env")
> +        env_filename = os.path.join(self.bindir, params.get("env", "env"))
>         env = shelve.open(env_filename, writeback=True)
>         kvm_log.debug("Contents of environment: %s" % str(env))
>
> --
> 1.5.4.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
Lucas Meneghel Rodrigues May 28, 2009, 1:26 p.m. UTC | #2
On Sun, 2009-05-24 at 18:46 +0300, Michael Goldish wrote:
> Do not use hardcoded environment filename 'env'. Instead use the value
> specified by the 'env' parameter. If unspecified, use 'env' as the filename.

Looks good to me!

> This is important for parallel execution; it may be necessary to use a separate
> environment file for each process.
> 
> Signed-off-by: Michael Goldish <mgoldish@redhat.com>
> ---
>  client/tests/kvm_runtest_2/kvm_runtest_2.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/client/tests/kvm_runtest_2/kvm_runtest_2.py b/client/tests/kvm_runtest_2/kvm_runtest_2.py
> index fda7282..a69951b 100644
> --- a/client/tests/kvm_runtest_2/kvm_runtest_2.py
> +++ b/client/tests/kvm_runtest_2/kvm_runtest_2.py
> @@ -64,7 +64,7 @@ class kvm_runtest_2(test.test):
>              self.write_test_keyval({key: params[key]})
>  
>          # Open the environment file
> -        env_filename = os.path.join(self.bindir, "env")
> +        env_filename = os.path.join(self.bindir, params.get("env", "env"))
>          env = shelve.open(env_filename, writeback=True)
>          kvm_log.debug("Contents of environment: %s" % str(env))
>
diff mbox

Patch

diff --git a/client/tests/kvm_runtest_2/kvm_runtest_2.py b/client/tests/kvm_runtest_2/kvm_runtest_2.py
index fda7282..a69951b 100644
--- a/client/tests/kvm_runtest_2/kvm_runtest_2.py
+++ b/client/tests/kvm_runtest_2/kvm_runtest_2.py
@@ -64,7 +64,7 @@  class kvm_runtest_2(test.test):
             self.write_test_keyval({key: params[key]})
 
         # Open the environment file
-        env_filename = os.path.join(self.bindir, "env")
+        env_filename = os.path.join(self.bindir, params.get("env", "env"))
         env = shelve.open(env_filename, writeback=True)
         kvm_log.debug("Contents of environment: %s" % str(env))