summaryrefslogtreecommitdiff
path: root/ec2init
diff options
context:
space:
mode:
authorSoren Hansen <soren@canonical.com>2009-08-10 23:10:11 +0200
committerSoren Hansen <soren@canonical.com>2009-08-10 23:10:11 +0200
commitd85c3f27482620927de6946e2e8d24c1dc31dfd2 (patch)
tree31cb8ed87db89047a1e2924e2d80fd6e6c8be6d2 /ec2init
parentce4d0c0e1004f64a599f93e48b8fc7abcc1eaf25 (diff)
downloadvyos-cloud-init-d85c3f27482620927de6946e2e8d24c1dc31dfd2.tar.gz
vyos-cloud-init-d85c3f27482620927de6946e2e8d24c1dc31dfd2.zip
Only return the first part of local-hostname.
Diffstat (limited to 'ec2init')
-rw-r--r--ec2init/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ec2init/__init__.py b/ec2init/__init__.py
index c8e7ba2f..540b1c13 100644
--- a/ec2init/__init__.py
+++ b/ec2init/__init__.py
@@ -71,7 +71,9 @@ class EC2Init():
return self.get_instance_metadata()['availability-zone']
def get_hostname(self):
- return self.get_instance_metadata()['local-hostname']
+ hostname = self.get_instance_metadata()['local-hostname']
+ hostname = hostname.split('.')[0]
+ return hostname
def get_mirror_from_availability_zone(self, availability_zone):
if zone.startswith("us"):