Comment 1 for bug 854614

Revision history for this message
Scott Moser (smoser) wrote :

At least in this case, it looks like what I need is
  FLAGS.dhcp_domain
which is set in nova/network/linux_net.py .

but my simple patch to nova/api/ec2/cloud.py:
- hostname = instance_ref['hostname']
+ hostname = "%s.%s" % (instance_ref['hostname'], FLAGS.dhcp_domain)

resulted in
(nova.api.ec2.metadata): TRACE: Traceback (most recent call last):
(nova.api.ec2.metadata): TRACE: File "/home/ubuntu/src/nova/nova/api/ec2/metadatarequesthandler.py", line 79, in __call__
(nova.api.ec2.metadata): TRACE: meta_data = self.cc.get_metadata(remote_address)
(nova.api.ec2.metadata): TRACE: File "/home/ubuntu/src/nova/nova/api/ec2/cloud.py", line 329, in get_metadata
(nova.api.ec2.metadata): TRACE: hostname = "%s.%s" % (instance_ref['hostname'], FLAGS.dhcp_domain)
(nova.api.ec2.metadata): TRACE: File "/home/ubuntu/src/nova/nova/flags.py", line 144, in __getattr__
(nova.api.ec2.metadata): TRACE: val = gflags.FlagValues.__getattr__(self, name)
(nova.api.ec2.metadata): TRACE: File "/usr/lib/python2.7/dist-packages/gflags.py", line 935, in __getattr__
(nova.api.ec2.metadata): TRACE: raise AttributeError(name)
(nova.api.ec2.metadata): TRACE: AttributeError: dhcp_domain
(nova.api.ec2.metadata): TRACE:

I not sure that 'dhcp_domain' is actually what we want, but we want something.