Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Commit

Permalink
Set hostname field, not name field for hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Jan 29, 2016
1 parent da26641 commit 102137e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cattle/plugins/docker/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _add_resources(self, ping, pong):
compute = {
'type': 'host',
'kind': 'docker',
'name': Config.hostname(),
'hostname': Config.hostname(),
'createLabels': self._get_host_create_labels(),
'labels': self._get_host_labels(),
'physicalHostUuid': physical_host['uuid'],
Expand All @@ -264,7 +264,7 @@ def _add_resources(self, ping, pong):
pool = {
'type': 'storagePool',
'kind': 'docker',
'name': compute['name'] + ' Storage Pool',
'name': compute['hostname'] + ' Storage Pool',
'hostUuid': compute['uuid'],
'uuid': compute['uuid'] + '-pool'
}
Expand Down
2 changes: 1 addition & 1 deletion tests/docker/ping_resp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"type" : "host",
"uuid" : "testuuid",
"name" : "localhost",
"hostname" : "localhost",
"physicalHostUuid" : "hostuuid",
"kind" : "docker",
"labels" : {
Expand Down
2 changes: 1 addition & 1 deletion tests/docker/ping_stat_exception_resp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"type" : "host",
"uuid" : "testuuid",
"name" : "localhost",
"hostname" : "localhost",
"physicalHostUuid" : "hostuuid",
"kind" : "docker",
"info" : null,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,9 +1223,9 @@ def pre(req):
def assert_ping_stat_resources(resp):
hostname = Config.hostname()
pool_name = hostname + ' Storage Pool'
assert resp['data']['resources'][0]['name'] == hostname
assert resp['data']['resources'][0]['hostname'] == hostname
assert resp['data']['resources'][1]['name'] == pool_name
resp['data']['resources'][0]['name'] = 'localhost'
resp['data']['resources'][0]['hostname'] = 'localhost'
resp['data']['resources'][1]['name'] = 'localhost Storage Pool'


Expand Down

0 comments on commit 102137e

Please sign in to comment.