diff options
author | Ben Howard <ben.howard@canonical.com> | 2015-01-14 07:29:57 -0700 |
---|---|---|
committer | Ben Howard <ben.howard@canonical.com> | 2015-01-14 07:29:57 -0700 |
commit | bd0c29c2f298ad060bba88ddbb4d2d11ab07cafe (patch) | |
tree | e05ab21629f0e87908e0ac91d8c5c648270f962b /tests | |
parent | 62e9e73e3ed8467fc4d4d95f76ed0443c50f176c (diff) | |
download | vyos-cloud-init-bd0c29c2f298ad060bba88ddbb4d2d11ab07cafe.tar.gz vyos-cloud-init-bd0c29c2f298ad060bba88ddbb4d2d11ab07cafe.zip |
Use the short name for GCE hostnames per GCE's request (LP: #1383794).
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unittests/test_datasource/test_gce.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/unittests/test_datasource/test_gce.py b/tests/unittests/test_datasource/test_gce.py index 89251b0e..06050bb1 100644 --- a/tests/unittests/test_datasource/test_gce.py +++ b/tests/unittests/test_datasource/test_gce.py @@ -99,7 +99,8 @@ class TestDataSourceGCE(test_helpers.HttprettyTestCase): body=_new_request_callback()) self.ds.get_data() - self.assertEqual(GCE_META.get('instance/hostname'), + shostname = GCE_META.get('instance/hostname').split('.')[0] + self.assertEqual(shostname, self.ds.get_hostname()) self.assertEqual(GCE_META.get('instance/id'), @@ -126,8 +127,8 @@ class TestDataSourceGCE(test_helpers.HttprettyTestCase): self.assertEqual(GCE_META_PARTIAL.get('instance/id'), self.ds.get_instance_id()) - self.assertEqual(GCE_META_PARTIAL.get('instance/hostname'), - self.ds.get_hostname()) + shostname = GCE_META_PARTIAL.get('instance/hostname').split('.')[0] + self.assertEqual(shostname, self.ds.get_hostname()) @httpretty.activate def test_metadata_encoding(self): |