]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Changing the poll_duration parameter type to int
authorSayaji <sayaji15@gmail.com>
Fri, 20 Jun 2014 20:52:30 +0000 (13:52 -0700)
committerSayaji <sayaji15@gmail.com>
Fri, 20 Jun 2014 21:47:36 +0000 (14:47 -0700)
The poll_duration parameter is defined as a Str in config.py
but while using in code, it is converted to int. So just changing
the type in the config file, so no conversion is required when used

Change-Id: I1d10b4641e3ca8e464258857b27c450a43ad2e87
Closes-Bug:#1332283

etc/neutron/plugins/cisco/cisco_plugins.ini
neutron/plugins/cisco/common/config.py
neutron/plugins/cisco/n1kv/n1kv_neutron_plugin.py

index e065e73a41bfd737d5ad692493a71a0795cb416f..d191976ef36e666743651eab1ce03f7d8649f69c 100644 (file)
 # default_network_profile =
 # Example: default_network_profile = network_pool
 
-# (StrOpt) Time in seconds for which the plugin polls the VSM for updates in
+# (IntOpt) Time in seconds for which the plugin polls the VSM for updates in
 # policy profiles.
 #
 # poll_duration =
index a4a1196a8d8e9459c9c5935ebff44ef21bb2980b..255a42d9908a2ee887b4d766f2d6a49901c6ffe6 100644 (file)
@@ -78,7 +78,7 @@ cisco_n1k_opts = [
                help=_("N1K default policy profile")),
     cfg.StrOpt('network_node_policy_profile', default='dhcp_pp',
                help=_("N1K policy profile for network node")),
-    cfg.StrOpt('poll_duration', default='10',
+    cfg.IntOpt('poll_duration', default=10,
                help=_("N1K Policy profile polling duration in seconds")),
 ]
 
index 83defcf7cde355999923a0f382811f7451bbee34..2af13a9c37873dc8567e0341cee171f17c135ec0 100644 (file)
@@ -160,7 +160,7 @@ class N1kvNeutronPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
         """Start a green thread to pull policy profiles from VSM."""
         while True:
             self._populate_policy_profiles()
-            eventlet.sleep(int(c_conf.CISCO_N1K.poll_duration))
+            eventlet.sleep(c_conf.CISCO_N1K.poll_duration)
 
     def _populate_policy_profiles(self):
         """