Tony Asleson
2014-05-14 22:41:49 UTC
Python & JSON rpc changed from:
set_time_out -> time_out_set
get_time_out -> get_time_out
They now conform to noun-verb expectation we have
established in library.
Signed-off-by: Tony Asleson <***@redhat.com>
---
c_binding/lsm_mgmt.cpp | 4 ++--
c_binding/lsm_plugin_ipc.cpp | 4 ++--
plugin/nstor/nstor.py | 4 ++--
plugin/ontap/ontap.py | 12 ++++++------
plugin/sim/simarray.py | 4 ++--
plugin/sim/simulator.py | 8 ++++----
plugin/smispy/smis.py | 4 ++--
plugin/targetd/targetd.py | 4 ++--
plugin/v7k/ibmv7k.py | 4 ++--
python_binding/lsm/_client.py | 12 ++++++------
python_binding/lsm/_iplugin.py | 4 ++--
test/plugin_test.py | 4 ++--
12 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/c_binding/lsm_mgmt.cpp b/c_binding/lsm_mgmt.cpp
index 8d59137..b92a44b 100644
--- a/c_binding/lsm_mgmt.cpp
+++ b/c_binding/lsm_mgmt.cpp
@@ -366,7 +366,7 @@ int lsm_connect_timeout_set(lsm_connect *c, uint32_t timeout, lsm_flag flags)
Value response;
//No response data needed on set time out.
- return rpc(c, "set_time_out", parameters, response);
+ return rpc(c, "time_out_set", parameters, response);
}
int lsm_connect_timeout_get(lsm_connect *c, uint32_t *timeout, lsm_flag flags)
@@ -384,7 +384,7 @@ int lsm_connect_timeout_get(lsm_connect *c, uint32_t *timeout, lsm_flag flags)
Value parameters(p);
Value response;
- rc = rpc(c, "get_time_out", parameters, response);
+ rc = rpc(c, "time_out_get", parameters, response);
if( rc == LSM_ERR_OK ) {
*timeout = response.asUint32_t();
}
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index 97a2c2b..cca61a6 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -2384,7 +2384,7 @@ static std::map<std::string,handler> dispatch = static_map<std::string,handler>
("fs_snapshot_delete", ss_delete)
("fs_snapshot_revert", ss_revert)
("fs_snapshots", ss_list)
- ("get_time_out", handle_get_time_out)
+ ("time_out_get", handle_get_time_out)
("initiators", handle_initiators)
("initiator_grant", initiator_grant)
("initiators_granted_to_volume", init_granted_to_volume)
@@ -2399,7 +2399,7 @@ static std::map<std::string,handler> dispatch = static_map<std::string,handler>
("pool_create_from_volumes", handle_pool_create_from_volumes)
("pool_create_from_pool", handle_pool_create_from_pool)
("pool_delete", handle_pool_delete)
- ("set_time_out", handle_set_time_out)
+ ("time_out_set", handle_set_time_out)
("shutdown", handle_shutdown)
("startup", handle_startup)
("systems", handle_system_list)
diff --git a/plugin/nstor/nstor.py b/plugin/nstor/nstor.py
index 3e47cb1..8254ab5 100644
--- a/plugin/nstor/nstor.py
+++ b/plugin/nstor/nstor.py
@@ -188,11 +188,11 @@ class NexentaStor(INfs, IStorageAreaNetwork):
self._request("destroy", "snapshot", [snapshot.name, ""])
return
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.timeout = ms
return
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.timeout
def shutdown(self, flags=0):
diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index b26d91d..3f87ecd 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -159,10 +159,10 @@ class Ontap(IStorageAreaNetwork, INfs):
System.STATUS_OK, '')
return self.f.validate()
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.f.timeout = ms / Ontap.TMO_CONV
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.f.timeout * Ontap.TMO_CONV
def shutdown(self, flags=0):
@@ -532,15 +532,15 @@ class Ontap(IStorageAreaNetwork, INfs):
double if it's reasonable to try and get this operation to happen
"""
- current_tmo = self.get_time_out()
+ current_tmo = self.time_out_get()
try:
#If the user selects a short timeout we may not be able
#to restore the array back, so lets give the array
#a chance to recover.
if current_tmo < 30000:
- self.set_time_out(60000)
+ self.time_out_set(60000)
else:
- self.set_time_out(current_tmo * 2)
+ self.time_out_set(current_tmo * 2)
self.f.volume_resize(vol, size_diff_kb)
except:
@@ -551,7 +551,7 @@ class Ontap(IStorageAreaNetwork, INfs):
+ traceback.format_exc())
finally:
#Restore timeout.
- self.set_time_out(current_tmo)
+ self.time_out_set(current_tmo)
def _na_volume_resize_restore(self, vol, size_diff):
try:
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
index 7cb6493..29268ad 100644
--- a/plugin/sim/simarray.py
+++ b/plugin/sim/simarray.py
@@ -128,10 +128,10 @@ class SimArray(object):
def job_free(self, job_id, flags=0):
return self.data.job_free(job_id, flags=0)
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
return self.data.set_time_out(ms, flags)
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.data.get_time_out(flags)
def systems(self):
diff --git a/plugin/sim/simulator.py b/plugin/sim/simulator.py
index 1ea1a45..b489cb5 100644
--- a/plugin/sim/simulator.py
+++ b/plugin/sim/simulator.py
@@ -66,12 +66,12 @@ class SimPlugin(INfs, IStorageAreaNetwork):
"""
return sim_data
- def set_time_out(self, ms, flags=0):
- self.sim_array.set_time_out(ms, flags)
+ def time_out_set(self, ms, flags=0):
+ self.sim_array.time_out_set(ms, flags)
return None
- def get_time_out(self, flags=0):
- return self.sim_array.get_time_out(flags)
+ def time_out_get(self, flags=0):
+ return self.sim_array.time_out_get(flags)
def capabilities(self, system, flags=0):
rc = Capabilities()
diff --git a/plugin/smispy/smis.py b/plugin/smispy/smis.py
index 0cf0038..c63d8cd 100644
--- a/plugin/smispy/smis.py
+++ b/plugin/smispy/smis.py
@@ -587,10 +587,10 @@ class Smis(IStorageAreaNetwork):
else:
raise e
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.tmo = ms
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.tmo
def shutdown(self, flags=0):
diff --git a/plugin/targetd/targetd.py b/plugin/targetd/targetd.py
index d93665c..b437ce5 100644
--- a/plugin/targetd/targetd.py
+++ b/plugin/targetd/targetd.py
@@ -83,11 +83,11 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
'Authorization': 'Basic %s' % (auth,)}
@handle_errors
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.tmo = ms
@handle_errors
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.tmo
@handle_errors
diff --git a/plugin/v7k/ibmv7k.py b/plugin/v7k/ibmv7k.py
index 16750d0..130e28d 100644
--- a/plugin/v7k/ibmv7k.py
+++ b/plugin/v7k/ibmv7k.py
@@ -384,13 +384,13 @@ class IbmV7k(IStorageAreaNetwork):
si = self._get_system_info()
self.sys_info = System(si['id'], si['name'], System.STATUS_OK, '')
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.tmo = ms
self.ssh.close()
self.ssh = SSHClient(self.up['host'], self.up['username'],
self.password, self.tmo)
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.tmo
def shutdown(self, flags=0):
diff --git a/python_binding/lsm/_client.py b/python_binding/lsm/_client.py
index ec7d87e..f34c87c 100644
--- a/python_binding/lsm/_client.py
+++ b/python_binding/lsm/_client.py
@@ -200,26 +200,26 @@ class Client(INetworkAttachedStorage):
# @param ms Time-out in ms
# @param flags Reserved for future use, must be zero.
@_return_requires(None)
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
"""
Sets any time-outs for the plug-in (ms)
Return None on success, else LsmError exception
"""
- return self._tp.rpc('set_time_out', _del_self(locals()))
+ return self._tp.rpc('time_out_set', _del_self(locals()))
## Retrieves the current time-out value.
# @param self The this pointer
# @param flags Reserved for future use, must be zero.
# @returns Time-out value
@_return_requires(int)
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
"""
Retrieves the current time-out
Return time-out in ms, else raise LsmError
"""
- return self._tp.rpc('get_time_out', _del_self(locals()))
+ return self._tp.rpc('time_out_get', _del_self(locals()))
## Retrieves the status of the specified job id.
# @param self The this pointer
@@ -1143,8 +1143,8 @@ class _TestClient(unittest.TestCase):
def test_tmo(self):
expected = 40000
- self.c.set_time_out(expected)
- tmo = self.c.get_time_out()
+ self.c.time_out_set(expected)
+ tmo = self.c.time_out_get()
self.assertTrue(tmo == expected)
def test_job_errors(self):
diff --git a/python_binding/lsm/_iplugin.py b/python_binding/lsm/_iplugin.py
index b1ff58f..493a093 100644
--- a/python_binding/lsm/_iplugin.py
+++ b/python_binding/lsm/_iplugin.py
@@ -39,7 +39,7 @@ class IPlugin(object):
pass
@_abstractmethod
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
"""
Sets any time-outs for the plug-in (ms)
@@ -48,7 +48,7 @@ class IPlugin(object):
pass
@_abstractmethod
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
"""
Retrieves the current time-out
diff --git a/test/plugin_test.py b/test/plugin_test.py
index c7a20d0..0cdf99e 100755
--- a/test/plugin_test.py
+++ b/test/plugin_test.py
@@ -260,8 +260,8 @@ class TestPlugin(unittest.TestCase):
def test_timeout(self):
tmo = 40000
- self.c.set_time_out(tmo)
- self.assertEquals(self.c.get_time_out(), tmo)
+ self.c.time_out_set(tmo)
+ self.assertEquals(self.c.time_out_get(), tmo)
def test_systems_list(self):
arrays = self.c.systems()
set_time_out -> time_out_set
get_time_out -> get_time_out
They now conform to noun-verb expectation we have
established in library.
Signed-off-by: Tony Asleson <***@redhat.com>
---
c_binding/lsm_mgmt.cpp | 4 ++--
c_binding/lsm_plugin_ipc.cpp | 4 ++--
plugin/nstor/nstor.py | 4 ++--
plugin/ontap/ontap.py | 12 ++++++------
plugin/sim/simarray.py | 4 ++--
plugin/sim/simulator.py | 8 ++++----
plugin/smispy/smis.py | 4 ++--
plugin/targetd/targetd.py | 4 ++--
plugin/v7k/ibmv7k.py | 4 ++--
python_binding/lsm/_client.py | 12 ++++++------
python_binding/lsm/_iplugin.py | 4 ++--
test/plugin_test.py | 4 ++--
12 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/c_binding/lsm_mgmt.cpp b/c_binding/lsm_mgmt.cpp
index 8d59137..b92a44b 100644
--- a/c_binding/lsm_mgmt.cpp
+++ b/c_binding/lsm_mgmt.cpp
@@ -366,7 +366,7 @@ int lsm_connect_timeout_set(lsm_connect *c, uint32_t timeout, lsm_flag flags)
Value response;
//No response data needed on set time out.
- return rpc(c, "set_time_out", parameters, response);
+ return rpc(c, "time_out_set", parameters, response);
}
int lsm_connect_timeout_get(lsm_connect *c, uint32_t *timeout, lsm_flag flags)
@@ -384,7 +384,7 @@ int lsm_connect_timeout_get(lsm_connect *c, uint32_t *timeout, lsm_flag flags)
Value parameters(p);
Value response;
- rc = rpc(c, "get_time_out", parameters, response);
+ rc = rpc(c, "time_out_get", parameters, response);
if( rc == LSM_ERR_OK ) {
*timeout = response.asUint32_t();
}
diff --git a/c_binding/lsm_plugin_ipc.cpp b/c_binding/lsm_plugin_ipc.cpp
index 97a2c2b..cca61a6 100644
--- a/c_binding/lsm_plugin_ipc.cpp
+++ b/c_binding/lsm_plugin_ipc.cpp
@@ -2384,7 +2384,7 @@ static std::map<std::string,handler> dispatch = static_map<std::string,handler>
("fs_snapshot_delete", ss_delete)
("fs_snapshot_revert", ss_revert)
("fs_snapshots", ss_list)
- ("get_time_out", handle_get_time_out)
+ ("time_out_get", handle_get_time_out)
("initiators", handle_initiators)
("initiator_grant", initiator_grant)
("initiators_granted_to_volume", init_granted_to_volume)
@@ -2399,7 +2399,7 @@ static std::map<std::string,handler> dispatch = static_map<std::string,handler>
("pool_create_from_volumes", handle_pool_create_from_volumes)
("pool_create_from_pool", handle_pool_create_from_pool)
("pool_delete", handle_pool_delete)
- ("set_time_out", handle_set_time_out)
+ ("time_out_set", handle_set_time_out)
("shutdown", handle_shutdown)
("startup", handle_startup)
("systems", handle_system_list)
diff --git a/plugin/nstor/nstor.py b/plugin/nstor/nstor.py
index 3e47cb1..8254ab5 100644
--- a/plugin/nstor/nstor.py
+++ b/plugin/nstor/nstor.py
@@ -188,11 +188,11 @@ class NexentaStor(INfs, IStorageAreaNetwork):
self._request("destroy", "snapshot", [snapshot.name, ""])
return
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.timeout = ms
return
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.timeout
def shutdown(self, flags=0):
diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index b26d91d..3f87ecd 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -159,10 +159,10 @@ class Ontap(IStorageAreaNetwork, INfs):
System.STATUS_OK, '')
return self.f.validate()
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.f.timeout = ms / Ontap.TMO_CONV
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.f.timeout * Ontap.TMO_CONV
def shutdown(self, flags=0):
@@ -532,15 +532,15 @@ class Ontap(IStorageAreaNetwork, INfs):
double if it's reasonable to try and get this operation to happen
"""
- current_tmo = self.get_time_out()
+ current_tmo = self.time_out_get()
try:
#If the user selects a short timeout we may not be able
#to restore the array back, so lets give the array
#a chance to recover.
if current_tmo < 30000:
- self.set_time_out(60000)
+ self.time_out_set(60000)
else:
- self.set_time_out(current_tmo * 2)
+ self.time_out_set(current_tmo * 2)
self.f.volume_resize(vol, size_diff_kb)
except:
@@ -551,7 +551,7 @@ class Ontap(IStorageAreaNetwork, INfs):
+ traceback.format_exc())
finally:
#Restore timeout.
- self.set_time_out(current_tmo)
+ self.time_out_set(current_tmo)
def _na_volume_resize_restore(self, vol, size_diff):
try:
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
index 7cb6493..29268ad 100644
--- a/plugin/sim/simarray.py
+++ b/plugin/sim/simarray.py
@@ -128,10 +128,10 @@ class SimArray(object):
def job_free(self, job_id, flags=0):
return self.data.job_free(job_id, flags=0)
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
return self.data.set_time_out(ms, flags)
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.data.get_time_out(flags)
def systems(self):
diff --git a/plugin/sim/simulator.py b/plugin/sim/simulator.py
index 1ea1a45..b489cb5 100644
--- a/plugin/sim/simulator.py
+++ b/plugin/sim/simulator.py
@@ -66,12 +66,12 @@ class SimPlugin(INfs, IStorageAreaNetwork):
"""
return sim_data
- def set_time_out(self, ms, flags=0):
- self.sim_array.set_time_out(ms, flags)
+ def time_out_set(self, ms, flags=0):
+ self.sim_array.time_out_set(ms, flags)
return None
- def get_time_out(self, flags=0):
- return self.sim_array.get_time_out(flags)
+ def time_out_get(self, flags=0):
+ return self.sim_array.time_out_get(flags)
def capabilities(self, system, flags=0):
rc = Capabilities()
diff --git a/plugin/smispy/smis.py b/plugin/smispy/smis.py
index 0cf0038..c63d8cd 100644
--- a/plugin/smispy/smis.py
+++ b/plugin/smispy/smis.py
@@ -587,10 +587,10 @@ class Smis(IStorageAreaNetwork):
else:
raise e
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.tmo = ms
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.tmo
def shutdown(self, flags=0):
diff --git a/plugin/targetd/targetd.py b/plugin/targetd/targetd.py
index d93665c..b437ce5 100644
--- a/plugin/targetd/targetd.py
+++ b/plugin/targetd/targetd.py
@@ -83,11 +83,11 @@ class TargetdStorage(IStorageAreaNetwork, INfs):
'Authorization': 'Basic %s' % (auth,)}
@handle_errors
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.tmo = ms
@handle_errors
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.tmo
@handle_errors
diff --git a/plugin/v7k/ibmv7k.py b/plugin/v7k/ibmv7k.py
index 16750d0..130e28d 100644
--- a/plugin/v7k/ibmv7k.py
+++ b/plugin/v7k/ibmv7k.py
@@ -384,13 +384,13 @@ class IbmV7k(IStorageAreaNetwork):
si = self._get_system_info()
self.sys_info = System(si['id'], si['name'], System.STATUS_OK, '')
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
self.tmo = ms
self.ssh.close()
self.ssh = SSHClient(self.up['host'], self.up['username'],
self.password, self.tmo)
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
return self.tmo
def shutdown(self, flags=0):
diff --git a/python_binding/lsm/_client.py b/python_binding/lsm/_client.py
index ec7d87e..f34c87c 100644
--- a/python_binding/lsm/_client.py
+++ b/python_binding/lsm/_client.py
@@ -200,26 +200,26 @@ class Client(INetworkAttachedStorage):
# @param ms Time-out in ms
# @param flags Reserved for future use, must be zero.
@_return_requires(None)
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
"""
Sets any time-outs for the plug-in (ms)
Return None on success, else LsmError exception
"""
- return self._tp.rpc('set_time_out', _del_self(locals()))
+ return self._tp.rpc('time_out_set', _del_self(locals()))
## Retrieves the current time-out value.
# @param self The this pointer
# @param flags Reserved for future use, must be zero.
# @returns Time-out value
@_return_requires(int)
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
"""
Retrieves the current time-out
Return time-out in ms, else raise LsmError
"""
- return self._tp.rpc('get_time_out', _del_self(locals()))
+ return self._tp.rpc('time_out_get', _del_self(locals()))
## Retrieves the status of the specified job id.
# @param self The this pointer
@@ -1143,8 +1143,8 @@ class _TestClient(unittest.TestCase):
def test_tmo(self):
expected = 40000
- self.c.set_time_out(expected)
- tmo = self.c.get_time_out()
+ self.c.time_out_set(expected)
+ tmo = self.c.time_out_get()
self.assertTrue(tmo == expected)
def test_job_errors(self):
diff --git a/python_binding/lsm/_iplugin.py b/python_binding/lsm/_iplugin.py
index b1ff58f..493a093 100644
--- a/python_binding/lsm/_iplugin.py
+++ b/python_binding/lsm/_iplugin.py
@@ -39,7 +39,7 @@ class IPlugin(object):
pass
@_abstractmethod
- def set_time_out(self, ms, flags=0):
+ def time_out_set(self, ms, flags=0):
"""
Sets any time-outs for the plug-in (ms)
@@ -48,7 +48,7 @@ class IPlugin(object):
pass
@_abstractmethod
- def get_time_out(self, flags=0):
+ def time_out_get(self, flags=0):
"""
Retrieves the current time-out
diff --git a/test/plugin_test.py b/test/plugin_test.py
index c7a20d0..0cdf99e 100755
--- a/test/plugin_test.py
+++ b/test/plugin_test.py
@@ -260,8 +260,8 @@ class TestPlugin(unittest.TestCase):
def test_timeout(self):
tmo = 40000
- self.c.set_time_out(tmo)
- self.assertEquals(self.c.get_time_out(), tmo)
+ self.c.time_out_set(tmo)
+ self.assertEquals(self.c.time_out_get(), tmo)
def test_systems_list(self):
arrays = self.c.systems()
--
1.8.2.1
1.8.2.1