diff options
| author | Zygmunt Krynicki <zygmunt.krynicki@canonical.com> | 2014-06-11 17:28:53 +0200 |
|---|---|---|
| committer | Zygmunt Krynicki <zygmunt.krynicki@canonical.com> | 2014-06-11 17:28:53 +0200 |
| commit | b2a0868f97c78d846b67fc03a5494614f6dbd32a (patch) | |
| tree | 315d2e231af6cdc049d5e893c5ca135c20bb7e95 /bin | |
| parent | ca08533889fb11ff94389ad055fe3e55a1f965bb (diff) | |
providers:checkbox:gateway_ping_test: replace _hex_to_dec() with plain int()
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/gateway_ping_test | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/bin/gateway_ping_test b/bin/gateway_ping_test index 1666ce5..5ba37e9 100755 --- a/bin/gateway_ping_test +++ b/bin/gateway_ping_test @@ -18,13 +18,6 @@ class Route: Gets routing information from the system. """ - # auxiliary functions - def _hex_to_dec(self, string): - """ - Returns the integer value of a hexadecimal string s - """ - return int(string, 16) - def _num_to_dotted_quad(self, number): """ Convert long int to dotted quad string @@ -48,8 +41,8 @@ class Route: w = h.search(route) if w: if w.group("def_gateway"): - return (self._num_to_dotted_quad( - self._hex_to_dec(w.group("def_gateway")))) + return self._num_to_dotted_quad( + int(w.group("def_gateway"), 16)) else: logging.error(_("Could not find def gateway info in /proc")) return None |
