{"action":"created","issue":{"url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/225","repository_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2","labels_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/225/labels{/name}","comments_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/225/comments","events_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/225/events","html_url":"https://github.com/test-kitchen/kitchen-ec2/issues/225","id":133687889,"number":225,"title":"transport.username is not respected","user":{"login":"alexpop","id":107378,"avatar_url":"https://avatars.githubusercontent.com/u/107378?v=3","gravatar_id":"","url":"https://api.github.com/users/alexpop","html_url":"https://github.com/alexpop","followers_url":"https://api.github.com/users/alexpop/followers","following_url":"https://api.github.com/users/alexpop/following{/other_user}","gists_url":"https://api.github.com/users/alexpop/gists{/gist_id}","starred_url":"https://api.github.com/users/alexpop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexpop/subscriptions","organizations_url":"https://api.github.com/users/alexpop/orgs","repos_url":"https://api.github.com/users/alexpop/repos","events_url":"https://api.github.com/users/alexpop/events{/privacy}","received_events_url":"https://api.github.com/users/alexpop/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-02-15T11:14:58Z","updated_at":"2016-03-09T20:27:39Z","closed_at":null,"body":"With code in master(c97798142d639ff3cff435b5516eb3be00bce6a3), I'm using this kitchen.ec2.yml config to converge `us-west-1` instances:\r\n\r\n```\r\nplatforms:\r\n  - name: centos-6\r\n    driver:\r\n      image_id: ami-e73ccda3\r\n    transport:\r\n      username: root\r\n    provisioner:\r\n      sudo: false\r\n```\r\n\r\nKitchen is attempting to login with the default username(`centos`) instead of the configured one(`root`):\r\n\r\n\r\n```\r\n$ bundle exec kitchen converge\r\n-----> Starting Kitchen (v1.5.0)\r\n-----> Creating <default-centos-6>...\r\n       Detected platform: centos version 5 on x86_64. Instance Type: m3.medium. Default username: centos (default).\r\n...SNIP...\r\n       Waited 25/300s for instance <i-3c16fb89> to become ready.\r\n       EC2 instance <i-3c16fb89> ready.\r\n       Waiting for SSH service on ec2-54-183-129-223.us-west-1.compute.amazonaws.com:22, retrying in 3 seconds\r\n       Waiting for SSH service on ec2-54-183-129-223.us-west-1.compute.amazonaws.com:22, retrying in 3 seconds\r\n       Waiting for SSH service on ec2-54-183-129-223.us-west-1.compute.amazonaws.com:22, retrying in 3 seconds\r\n...\r\n```\r\n\r\nAfter I cancel the `Waiting for SSH` loop, the contents of `.kitchen/default-centos-6.yml` is:\r\n\r\n```\r\n---\r\nusername: centos\r\nserver_id: i-3c16fb89\r\nhostname: ec2-54-183-129-223.us-west-1.compute.amazonaws.com\r\n```\r\n\r\nI'm able to converge fine with the same config if I use the kitchen-ec2 master ref 0e363e068c8d03978358b31b19b1f9dc09fac25d"},"comment":{"url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/comments/194492506","html_url":"https://github.com/test-kitchen/kitchen-ec2/issues/225#issuecomment-194492506","issue_url":"https://api.github.com/repos/test-kitchen/kitchen-ec2/issues/225","id":194492506,"user":{"login":"chrisgit","id":3491138,"avatar_url":"https://avatars.githubusercontent.com/u/3491138?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisgit","html_url":"https://github.com/chrisgit","followers_url":"https://api.github.com/users/chrisgit/followers","following_url":"https://api.github.com/users/chrisgit/following{/other_user}","gists_url":"https://api.github.com/users/chrisgit/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisgit/subscriptions","organizations_url":"https://api.github.com/users/chrisgit/orgs","repos_url":"https://api.github.com/users/chrisgit/repos","events_url":"https://api.github.com/users/chrisgit/events{/privacy}","received_events_url":"https://api.github.com/users/chrisgit/received_events","type":"User","site_admin":false},"created_at":"2016-03-09T20:27:39Z","updated_at":"2016-03-09T20:27:39Z","body":"Have just read the code, I see what you mean\r\n\r\n```\r\n      def update_username(state)\r\n        # TODO: if the user explicitly specified the transport's default username,\r\n        # do NOT overwrite it!\r\n        if instance.transport[:username] == instance.transport.class.defaults[:username]\r\n          debug(\"No SSH username specified: using default username #{actual_platform.username} \" \\\r\n                \" for image #{config[:image_id]}, which we detected as #{actual_platform}.\")\r\n          state[:username] = actual_platform.username\r\n        end\r\n      end\r\n\r\n...\r\n\r\n          def username\r\n            # Centos 6.x images use root as the username (but the \"centos 6\"\r\n            # updateable image uses \"centos\")\r\n            return \"root\" if version && version.start_with?(\"6.\")\r\n            \"centos\"\r\n          end\r\n```\r\n\r\nWe didn't specify the version, will try again tomorrow specifying a version."}}