Skip to content

The hostname should be fullyQualifiedDomainName instead of hostname#280

Closed
RoelVanNyen wants to merge 2 commits intoapache:trunkfrom
RoelVanNyen:trunk
Closed

The hostname should be fullyQualifiedDomainName instead of hostname#280
RoelVanNyen wants to merge 2 commits intoapache:trunkfrom
RoelVanNyen:trunk

Conversation

@RoelVanNyen
Copy link
Contributor

Otherwise we don`t know which machine this really is, you only see a part of the hostname.

@Kami
Copy link
Member

Kami commented Apr 23, 2014

@RoelVanNyen Can you please update the failing tests?

Thanks

@RoelVanNyen
Copy link
Contributor Author

Should be fixed now.

Thanks

@Kami
Copy link
Member

Kami commented Apr 23, 2014

@RoelVanNyen Actually, sorry. I just quickly glanced over this the first time.

I think a better approach would be to store this value in the extra['hostname'] attribute.

@RoelVanNyen
Copy link
Contributor Author

If you go to the softlayer panel and check the hosts you will see the names are equal to the fullyQualifiedDomainName and not the hostname, so it would be logical for me to use host['fullyQualifiedDomainName'] instead. Howhever if you really don`t want to do this then I would suggest putting the field into extra['fullyQualifiedDomainName'] instead of extra['hostname'].

What do you think?
Thanks

@Kami
Copy link
Member

Kami commented Apr 23, 2014

@RoelVanNyen Ah, if the Softlayer control panel uses fullyQualifiedDomainName for the display name, then using that in Libcloud makes sense as well.

@Kami
Copy link
Member

Kami commented Apr 23, 2014

Commits squashed and merged into trunk. Thanks.

@RoelVanNyen
Copy link
Contributor Author

Cool. However I don`t see your commit anywhere.
Where is it committed ?

Cheers,

@asfgit asfgit closed this in 48d3bfd Apr 23, 2014
@phamnamlong
Copy link

Hi @RoelVanNyen, I find this fix quite problematic. Imagine the following scenario:

You create a node by:

host = conn.create_node(name="first", image=image, size=size) 

Then, later you want to find this node by name:

def found_with_id(id):
  nodes = conn.list_nodes();
    for node in nodes:
      if node.name == id: # this is where the originally created name is not what it is now
        return node
  return None

Doesn't it break the generic purpose of libcloud where you will certainly have to "if conn is the SoftLayer" then check node.name == id + "example.com".

I suggest that the name is still the original created name while you will add extra attribute fullyQualifiedDomainName instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants