~psivaa/core-image-watcher/correct-output-queue

« back to all changes in this revision

Viewing changes to core_image_watcher/constants.py

  • Committer: Ubuntu CI Bot
  • Author(s): Celso Providelo
  • Date: 2015-04-01 01:49:03 UTC
  • mfrom: (11.1.2 flake8)
  • Revision ID: ubuntu_ci_bot-20150401014903-9auo1rxy26wfdpc1
Installing flake8 for tests and benefiting of its integration with setuptools for processing all installed files. [r=Thomi Richards]

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
SERVICE_NAME = "core-image-watcher"
26
26
 
 
27
 
27
28
def _get_hostname():
28
29
    """Return sanitized contents of /etc/hostname.
29
30
 
31
32
    are too big due to our long environment names ('<spec_name>-<MD5>').
32
33
    Linux (DNS for RFC1035, really) only supports labels up to 64 chars and
33
34
    the fallback varies from tool to tool, `cloud-init` chokes on longer
34
 
    names and sets 'ubuntu', `hostnamectl` (systemd) would truncate the
35
 
    given data. 
 
35
    names and sets 'ubuntu' (which is the value considered by socket.get*),
 
36
    `hostnamectl` (systemd) would truncate the given data.
36
37
 
37
38
    None of this is ideal to our applications, that's why we will operate
38
39
    on the pristine /etc/hostname and remove the 'juju-' and '-machine' terms
44
45
 
45
46
 
46
47
HOSTNAME = _get_hostname()
47