summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorCosmin Luță <cosmin.luta@avira.com>2012-03-04 16:44:33 +0200
committerCosmin Luță <cosmin.luta@avira.com>2012-03-04 16:44:33 +0200
commitc189b686805ae42a0aeb9a7a1e147f402cbcdf42 (patch)
tree17581d6e1b13666e808b31e1490f5d3319e3c598 /cloudinit
parent162af10bc6633d47ec8f3ece102f0bc915a0e33a (diff)
downloadvyos-cloud-init-c189b686805ae42a0aeb9a7a1e147f402cbcdf42.tar.gz
vyos-cloud-init-c189b686805ae42a0aeb9a7a1e147f402cbcdf42.zip
Refactored _get_default_gateway to get_default_gateway
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/DataSourceCS.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/DataSourceCS.py b/cloudinit/DataSourceCS.py
index 4d199ad2..a41f8fca 100644
--- a/cloudinit/DataSourceCS.py
+++ b/cloudinit/DataSourceCS.py
@@ -37,10 +37,10 @@ class DataSourceCS(DataSource.DataSource):
def __init__(self, sys_cfg=None):
DataSource.DataSource.__init__(self, sys_cfg)
- # Cloudstack has its metadata/userdata URLs located on http://<default-gateway-ip>/latest/
- self.metadata_address = "http://" + self._get_default_gateway() + "/"
+ # Cloudstack has its metadata/userdata URLs located at http://<default-gateway-ip>/latest/
+ self.metadata_address = "http://%s/" % self.get_default_gateway()
- def _get_default_gateway(self):
+ def get_default_gateway(self):
f = None
try:
f = open("/proc/net/route", "r")