+1

I like it.

- Bill

----- Original Message -----From: Christian Trautman <[email protected]>To: 
MartinX Klozik <[email protected]>Cc: 
[email protected]: Wed, 17 Aug 2016 10:05:01 -0400 
(EDT)Subject: Re: [opnfv-tech-discuss] [VSPERF] support CLI for all 
configuration parameters


+1

This would be extremely helpful for our CI scripts.

-Christian,


From: "MartinX Klozik" <[email protected]>To: 
[email protected]: Monday, August 15, 2016 9:18:07 
AMSubject: [opnfv-tech-discuss] [VSPERF] support CLI for all configuration      
  parameters


Hi Folks,
 
Currently VSPERF uses a lot of configuration options spread among several 
configuration files, but only a few of them are configurable &ldquo;on the 
fly&rdquo; by CLI option &ndash;test-params. During the past, there were 
several requirements to allow a CLI modification of various configuration 
options. So in these days some of them can be modified, but it is hard to find, 
which one (one have to consult documentation related to the specific feature).
 
What about a change which will allow to modify any option by CLI (and 
&ldquo;Parameters&rdquo; option of testcase definition)? It means, that for any 
configuration option (by default UPPER case name) its lower case form can be 
used to redefine the value through &ndash;test-params argument.
 

In a nutshell following patch will do the trick:
 

diff --git a/conf/__init__.py b/conf/__init__.py
index 4622823..d4332ac 100644
--- a/conf/__init__.py
+++ b/conf/__init__.py
@@ -34,7 +34,11 @@ class Settings(object):
         """Return a settings item value
         """
         if attr in self.__dict__:
-            return getattr(self, attr)
+            if attr == 'TEST_PARAMS':
+                return getattr(self, attr)
+            else:
+                # Check if parameter value was overridden by CLI option
+                return get_test_param(attr.lower(), getattr(self, attr))
         else:
             raise AttributeError("%r object has no attribute %r" %

                                  (self.__class__, attr))

 
Let me know what do you think (e.g. reply with +1).
 
If you&rsquo;ll find it useful, I&rsquo;ll create a ticket for that and prepare 
a patch. The final patch have to take into the account currently supported CLI 
parameters (i.e. code cleanup & type conversion/checking & testing).
 
Best Regards,
Martin

-------------------------------------------------------------- Intel Research 
and Development Ireland Limited Registered in Ireland Registered Office: 
Collinstown Industrial Park, Leixlip, County Kildare Registered Number: 308263
This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient(s). Any review or distribution by others is 
strictly prohibited. If you are not the intended recipient, please contact the 
sender and delete all copies.

_______________________________________________opnfv-tech-discuss mailing 
[email protected]https://lists.opnfv.org/mailman/listinfo/opnfv-tech-discuss


_______________________________________________
opnfv-tech-discuss mailing list
[email protected]
https://lists.opnfv.org/mailman/listinfo/opnfv-tech-discuss

Reply via email to