diff options
-rw-r--r-- | cloudinit/config/cc_salt_minion.py | 2 | ||||
-rw-r--r-- | cloudinit/sources/DataSourceCloudStack.py | 22 | ||||
-rw-r--r-- | tools/.lp-to-git-user | 5 | ||||
-rwxr-xr-x | tools/migrate-lp-user-to-github | 2 |
4 files changed, 26 insertions, 5 deletions
diff --git a/cloudinit/config/cc_salt_minion.py b/cloudinit/config/cc_salt_minion.py index cd9cb0b0..1c991d8d 100644 --- a/cloudinit/config/cc_salt_minion.py +++ b/cloudinit/config/cc_salt_minion.py @@ -59,7 +59,7 @@ class SaltConstants(object): # constants tailored for FreeBSD if util.is_FreeBSD(): - self.pkg_name = 'py27-salt' + self.pkg_name = 'py36-salt' self.srv_name = 'salt_minion' self.conf_dir = '/usr/local/etc/salt' # constants for any other OS diff --git a/cloudinit/sources/DataSourceCloudStack.py b/cloudinit/sources/DataSourceCloudStack.py index f185dc71..e333cb50 100644 --- a/cloudinit/sources/DataSourceCloudStack.py +++ b/cloudinit/sources/DataSourceCloudStack.py @@ -13,7 +13,7 @@ # This file is part of cloud-init. See LICENSE file for license information. import os -from socket import inet_ntoa +from socket import inet_ntoa, getaddrinfo, gaierror from struct import pack import time @@ -156,6 +156,17 @@ class DataSourceCloudStack(sources.DataSource): return self.metadata['availability-zone'] +def get_data_server(): + # Returns the metadataserver from dns + try: + addrinfo = getaddrinfo("data-server.", 80) + except gaierror: + LOG.debug("DNS Entry data-server not found") + return None + else: + return addrinfo[0][4][0] # return IP + + def get_default_gateway(): # Returns the default gateway ip address in the dotted format. lines = util.load_file("/proc/net/route").splitlines() @@ -218,7 +229,14 @@ def get_vr_address(): # If no virtual router is detected, fallback on default gateway. # See http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/4.8/virtual_machines/user-data.html # noqa - # Try networkd first... + # Try data-server DNS entry first + latest_address = get_data_server() + if latest_address: + LOG.debug("Found metadata server '%s' via data-server DNS entry", + latest_address) + return latest_address + + # Try networkd second... latest_address = dhcp.networkd_get_option_from_leases('SERVER_ADDRESS') if latest_address: LOG.debug("Found SERVER_ADDRESS '%s' via networkd_leases", diff --git a/tools/.lp-to-git-user b/tools/.lp-to-git-user index 04c7a9eb..eba1cd8e 100644 --- a/tools/.lp-to-git-user +++ b/tools/.lp-to-git-user @@ -1,6 +1,9 @@ { "chad.smith": "blackboxsw", + "i.galic": "igalic", + "larsks": "larsks", "legovini": "paride", "powersj": "powersj", - "raharper": "raharper" + "raharper": "raharper", + "tribaal": "chrisglass" }
\ No newline at end of file diff --git a/tools/migrate-lp-user-to-github b/tools/migrate-lp-user-to-github index f012d312..6a498072 100755 --- a/tools/migrate-lp-user-to-github +++ b/tools/migrate-lp-user-to-github @@ -212,7 +212,7 @@ def main(): try: lp_user_migrate_branch.createMergeProposal( commit_message=commit_msg, merge_target=master, needs_review=True) - except Exception as e: + except Exception: log('[launchpad] active merge proposal already exists at:\n' '{url}\n'.format(url=lp_merge_url)) else: |