← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~daniel-thewatkins/cloud-init/+git/cloud-init:bugfix/gce-ssh-key-attributes into cloud-init:master

 

Dan Watkins has proposed merging ~daniel-thewatkins/cloud-init/+git/cloud-init:bugfix/gce-ssh-key-attributes into cloud-init:master.

Requested reviews:
  cloud-init commiters (cloud-init-dev)
Related bugs:
  Bug #1693582 in cloud-init: "cloud-init uses a deprecated metadata path for GCE instance SSH keys"
  https://bugs.launchpad.net/cloud-init/+bug/1693582

For more details, see:
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/324642
-- 
Your team cloud-init commiters is requested to review the proposed merge of ~daniel-thewatkins/cloud-init/+git/cloud-init:bugfix/gce-ssh-key-attributes into cloud-init:master.
diff --git a/cloudinit/sources/DataSourceGCE.py b/cloudinit/sources/DataSourceGCE.py
index e9afda9..684eac8 100644
--- a/cloudinit/sources/DataSourceGCE.py
+++ b/cloudinit/sources/DataSourceGCE.py
@@ -71,7 +71,7 @@ class DataSourceGCE(sources.DataSource):
             ('availability-zone', ('instance/zone',), True, True),
             ('local-hostname', ('instance/hostname',), True, True),
             ('public-keys', ('project/attributes/sshKeys',
-                             'instance/attributes/sshKeys'), False, True),
+                             'instance/attributes/ssh-keys'), False, True),
             ('user-data', ('instance/attributes/user-data',), False, False),
             ('user-data-encoding', ('instance/attributes/user-data-encoding',),
              False, True),
diff --git a/tests/unittests/test_datasource/test_gce.py b/tests/unittests/test_datasource/test_gce.py
index 3eaa58e..6fd1341 100644
--- a/tests/unittests/test_datasource/test_gce.py
+++ b/tests/unittests/test_datasource/test_gce.py
@@ -140,7 +140,7 @@ class TestDataSourceGCE(test_helpers.HttprettyTestCase):
     def test_instance_level_ssh_keys_are_used(self):
         key_content = 'ssh-rsa JustAUser root@server'
         meta = GCE_META.copy()
-        meta['instance/attributes/sshKeys'] = 'user:{0}'.format(key_content)
+        meta['instance/attributes/ssh-keys'] = 'user:{0}'.format(key_content)
 
         _set_mock_metadata(meta)
         self.ds.get_data()
@@ -150,7 +150,7 @@ class TestDataSourceGCE(test_helpers.HttprettyTestCase):
     def test_instance_level_keys_replace_project_level_keys(self):
         key_content = 'ssh-rsa JustAUser root@server'
         meta = GCE_META.copy()
-        meta['instance/attributes/sshKeys'] = 'user:{0}'.format(key_content)
+        meta['instance/attributes/ssh-keys'] = 'user:{0}'.format(key_content)
 
         _set_mock_metadata(meta)
         self.ds.get_data()

Follow ups