8a7340
From 4114343d0cd2fc3e5566eed27272480e003c89cc Mon Sep 17 00:00:00 2001
18322d
From: Miroslav Rezanina <mrezanin@redhat.com>
18322d
Date: Thu, 31 May 2018 16:45:23 +0200
18322d
Subject: Add initial redhat setup
18322d
18322d
Rebase notes (18.5):
18322d
- added bash_completition file
18322d
- added cloud-id file
18322d
8a7340
Merged patches (19.4):
8a7340
- 4ab5a61 Fix for network configuration not persisting after reboot
8a7340
- 84cf125 Removing cloud-user from wheel
8a7340
- 31290ab Adding gating tests for Azure, ESXi and AWS
8a7340
18322d
Merged patches (18.5):
18322d
- 2d6b469 add power-state-change module to cloud_final_modules
18322d
- 764159f Adding systemd mount options to wait for cloud-init
18322d
- da4d99e Adding disk_setup to rhel/cloud.cfg
18322d
- f5c6832 Enable cloud-init by default on vmware
18322d
---
8a7340
 .gitignore                            |   1 +
18322d
 cloudinit/config/cc_chef.py           |   6 +-
18322d
 cloudinit/settings.py                 |   7 +-
18322d
 redhat/.gitignore                     |   1 +
18322d
 redhat/Makefile                       |  71 ++++++
8a7340
 redhat/Makefile.common                |  37 +++
18322d
 redhat/cloud-init-tmpfiles.conf       |   1 +
8a7340
 redhat/cloud-init.spec.template       | 438 ++++++++++++++++++++++++++++++++++
8a7340
 redhat/gating.yaml                    |   9 +
18322d
 redhat/rpmbuild/BUILD/.gitignore      |   3 +
18322d
 redhat/rpmbuild/RPMS/.gitignore       |   3 +
18322d
 redhat/rpmbuild/SOURCES/.gitignore    |   3 +
18322d
 redhat/rpmbuild/SPECS/.gitignore      |   3 +
18322d
 redhat/rpmbuild/SRPMS/.gitignore      |   3 +
8a7340
 redhat/scripts/frh.py                 |  27 +++
8a7340
 redhat/scripts/git-backport-diff      | 327 +++++++++++++++++++++++++
8a7340
 redhat/scripts/git-compile-check      | 215 +++++++++++++++++
18322d
 redhat/scripts/process-patches.sh     |  73 ++++++
18322d
 redhat/scripts/tarball_checksum.sh    |   3 +
18322d
 rhel/README.rhel                      |   5 +
18322d
 rhel/cloud-init-tmpfiles.conf         |   1 +
8a7340
 rhel/cloud.cfg                        |  69 ++++++
18322d
 rhel/systemd/cloud-config.service     |  18 ++
18322d
 rhel/systemd/cloud-config.target      |  11 +
18322d
 rhel/systemd/cloud-final.service      |  19 ++
18322d
 rhel/systemd/cloud-init-local.service |  31 +++
18322d
 rhel/systemd/cloud-init.service       |  25 ++
8a7340
 rhel/systemd/cloud-init.target        |   7 +
8a7340
 setup.py                              |  70 +-----
8a7340
 tools/read-version                    |  28 +--
8a7340
 30 files changed, 1417 insertions(+), 98 deletions(-)
18322d
 create mode 100644 redhat/.gitignore
18322d
 create mode 100644 redhat/Makefile
18322d
 create mode 100644 redhat/Makefile.common
18322d
 create mode 100644 redhat/cloud-init-tmpfiles.conf
18322d
 create mode 100644 redhat/cloud-init.spec.template
8a7340
 create mode 100644 redhat/gating.yaml
18322d
 create mode 100644 redhat/rpmbuild/BUILD/.gitignore
18322d
 create mode 100644 redhat/rpmbuild/RPMS/.gitignore
18322d
 create mode 100644 redhat/rpmbuild/SOURCES/.gitignore
18322d
 create mode 100644 redhat/rpmbuild/SPECS/.gitignore
18322d
 create mode 100644 redhat/rpmbuild/SRPMS/.gitignore
18322d
 create mode 100755 redhat/scripts/frh.py
18322d
 create mode 100755 redhat/scripts/git-backport-diff
18322d
 create mode 100755 redhat/scripts/git-compile-check
18322d
 create mode 100755 redhat/scripts/process-patches.sh
18322d
 create mode 100755 redhat/scripts/tarball_checksum.sh
18322d
 create mode 100644 rhel/README.rhel
18322d
 create mode 100644 rhel/cloud-init-tmpfiles.conf
18322d
 create mode 100644 rhel/cloud.cfg
18322d
 create mode 100644 rhel/systemd/cloud-config.service
18322d
 create mode 100644 rhel/systemd/cloud-config.target
18322d
 create mode 100644 rhel/systemd/cloud-final.service
18322d
 create mode 100644 rhel/systemd/cloud-init-local.service
18322d
 create mode 100644 rhel/systemd/cloud-init.service
8a7340
 create mode 100644 rhel/systemd/cloud-init.target
18322d
18322d
diff --git a/cloudinit/config/cc_chef.py b/cloudinit/config/cc_chef.py
8a7340
index 0ad6b7f..e4408a4 100644
18322d
--- a/cloudinit/config/cc_chef.py
18322d
+++ b/cloudinit/config/cc_chef.py
18322d
@@ -33,7 +33,7 @@ file).
18322d
 
18322d
     chef:
18322d
        directories: (defaulting to /etc/chef, /var/log/chef, /var/lib/chef,
18322d
-                     /var/cache/chef, /var/backups/chef, /var/run/chef)
18322d
+                     /var/cache/chef, /var/backups/chef, /run/chef)
18322d
        validation_cert: (optional string to be written to file validation_key)
18322d
                         special value 'system' means set use existing file
18322d
        validation_key: (optional the path for validation_cert. default
8a7340
@@ -89,7 +89,7 @@ CHEF_DIRS = tuple([
18322d
     '/var/lib/chef',
18322d
     '/var/cache/chef',
18322d
     '/var/backups/chef',
18322d
-    '/var/run/chef',
18322d
+    '/run/chef',
18322d
 ])
18322d
 REQUIRED_CHEF_DIRS = tuple([
18322d
     '/etc/chef',
8a7340
@@ -113,7 +113,7 @@ CHEF_RB_TPL_DEFAULTS = {
18322d
     'json_attribs': CHEF_FB_PATH,
18322d
     'file_cache_path': "/var/cache/chef",
18322d
     'file_backup_path': "/var/backups/chef",
18322d
-    'pid_file': "/var/run/chef/client.pid",
18322d
+    'pid_file': "/run/chef/client.pid",
18322d
     'show_time': True,
8a7340
     'encrypted_data_bag_secret': None,
18322d
 }
18322d
diff --git a/cloudinit/settings.py b/cloudinit/settings.py
8a7340
index ca4ffa8..3a04a58 100644
18322d
--- a/cloudinit/settings.py
18322d
+++ b/cloudinit/settings.py
8a7340
@@ -46,13 +46,16 @@ CFG_BUILTIN = {
18322d
     ],
18322d
     'def_log_file': '/var/log/cloud-init.log',
18322d
     'log_cfgs': [],
18322d
-    'syslog_fix_perms': ['syslog:adm', 'root:adm', 'root:wheel', 'root:root'],
18322d
+    'mount_default_fields': [None, None, 'auto', 'defaults,nofail', '0', '2'],
18322d
+    'ssh_deletekeys': False,
18322d
+    'ssh_genkeytypes': [],
18322d
+    'syslog_fix_perms': [],
18322d
     'system_info': {
18322d
         'paths': {
18322d
             'cloud_dir': '/var/lib/cloud',
18322d
             'templates_dir': '/etc/cloud/templates/',
18322d
         },
18322d
-        'distro': 'ubuntu',
18322d
+        'distro': 'rhel',
18322d
         'network': {'renderers': None},
18322d
     },
18322d
     'vendor_data': {'enabled': True, 'prefix': []},
18322d
diff --git a/rhel/README.rhel b/rhel/README.rhel
18322d
new file mode 100644
8a7340
index 0000000..aa29630
18322d
--- /dev/null
18322d
+++ b/rhel/README.rhel
18322d
@@ -0,0 +1,5 @@
18322d
+The following cloud-init modules are currently unsupported on this OS:
18322d
+ - apt_update_upgrade ('apt_update', 'apt_upgrade', 'apt_mirror', 'apt_preserve_sources_list', 'apt_old_mirror', 'apt_sources', 'debconf_selections', 'packages' options)
18322d
+ - byobu ('byobu_by_default' option)
18322d
+ - chef
18322d
+ - grub_dpkg
18322d
diff --git a/rhel/cloud-init-tmpfiles.conf b/rhel/cloud-init-tmpfiles.conf
18322d
new file mode 100644
8a7340
index 0000000..0c6d2a3
18322d
--- /dev/null
18322d
+++ b/rhel/cloud-init-tmpfiles.conf
18322d
@@ -0,0 +1 @@
18322d
+d /run/cloud-init 0700 root root - -
18322d
diff --git a/rhel/cloud.cfg b/rhel/cloud.cfg
18322d
new file mode 100644
8a7340
index 0000000..82e8bf6
18322d
--- /dev/null
18322d
+++ b/rhel/cloud.cfg
18322d
@@ -0,0 +1,69 @@
18322d
+users:
18322d
+ - default
18322d
+
18322d
+disable_root: 1
18322d
+ssh_pwauth:   0
18322d
+
18322d
+mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service', '0', '2']
18322d
+resize_rootfs_tmp: /dev
18322d
+ssh_deletekeys:   0
18322d
+ssh_genkeytypes:  ~
18322d
+syslog_fix_perms: ~
18322d
+disable_vmware_customization: false
18322d
+
18322d
+cloud_init_modules:
18322d
+ - disk_setup
18322d
+ - migrator
18322d
+ - bootcmd
18322d
+ - write-files
18322d
+ - growpart
18322d
+ - resizefs
18322d
+ - set_hostname
18322d
+ - update_hostname
18322d
+ - update_etc_hosts
18322d
+ - rsyslog
18322d
+ - users-groups
18322d
+ - ssh
18322d
+
18322d
+cloud_config_modules:
18322d
+ - mounts
18322d
+ - locale
18322d
+ - set-passwords
18322d
+ - rh_subscription
18322d
+ - yum-add-repo
18322d
+ - package-update-upgrade-install
18322d
+ - timezone
18322d
+ - puppet
18322d
+ - chef
18322d
+ - salt-minion
18322d
+ - mcollective
18322d
+ - disable-ec2-metadata
18322d
+ - runcmd
18322d
+
18322d
+cloud_final_modules:
18322d
+ - rightscale_userdata
18322d
+ - scripts-per-once
18322d
+ - scripts-per-boot
18322d
+ - scripts-per-instance
18322d
+ - scripts-user
18322d
+ - ssh-authkey-fingerprints
18322d
+ - keys-to-console
18322d
+ - phone-home
18322d
+ - final-message
18322d
+ - power-state-change
18322d
+
18322d
+system_info:
18322d
+  default_user:
18322d
+    name: cloud-user
18322d
+    lock_passwd: true
18322d
+    gecos: Cloud User
8a7340
+    groups: [adm, systemd-journal]
18322d
+    sudo: ["ALL=(ALL) NOPASSWD:ALL"]
18322d
+    shell: /bin/bash
18322d
+  distro: rhel
18322d
+  paths:
18322d
+    cloud_dir: /var/lib/cloud
18322d
+    templates_dir: /etc/cloud/templates
18322d
+  ssh_svcname: sshd
18322d
+
18322d
+# vim:syntax=yaml
18322d
diff --git a/rhel/systemd/cloud-config.service b/rhel/systemd/cloud-config.service
18322d
new file mode 100644
8a7340
index 0000000..f3dcd4b
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-config.service
18322d
@@ -0,0 +1,18 @@
18322d
+[Unit]
18322d
+Description=Apply the settings specified in cloud-config
18322d
+After=network-online.target cloud-config.target
18322d
+Wants=network-online.target cloud-config.target
18322d
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
18322d
+ConditionKernelCommandLine=!cloud-init=disabled
18322d
+
18322d
+[Service]
18322d
+Type=oneshot
18322d
+ExecStart=/usr/bin/cloud-init modules --mode=config
18322d
+RemainAfterExit=yes
18322d
+TimeoutSec=0
18322d
+
18322d
+# Output needs to appear in instance console output
18322d
+StandardOutput=journal+console
18322d
+
18322d
+[Install]
8a7340
+WantedBy=cloud-init.target
18322d
diff --git a/rhel/systemd/cloud-config.target b/rhel/systemd/cloud-config.target
18322d
new file mode 100644
8a7340
index 0000000..ae9b7d0
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-config.target
18322d
@@ -0,0 +1,11 @@
18322d
+# cloud-init normally emits a "cloud-config" upstart event to inform third
18322d
+# parties that cloud-config is available, which does us no good when we're
18322d
+# using systemd.  cloud-config.target serves as this synchronization point
18322d
+# instead.  Services that would "start on cloud-config" with upstart can
18322d
+# instead use "After=cloud-config.target" and "Wants=cloud-config.target"
18322d
+# as appropriate.
18322d
+
18322d
+[Unit]
18322d
+Description=Cloud-config availability
18322d
+Wants=cloud-init-local.service cloud-init.service
18322d
+After=cloud-init-local.service cloud-init.service
18322d
diff --git a/rhel/systemd/cloud-final.service b/rhel/systemd/cloud-final.service
18322d
new file mode 100644
8a7340
index 0000000..739b7e3
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-final.service
18322d
@@ -0,0 +1,19 @@
18322d
+[Unit]
18322d
+Description=Execute cloud user/final scripts
18322d
+After=network-online.target cloud-config.service rc-local.service
18322d
+Wants=network-online.target cloud-config.service
18322d
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
18322d
+ConditionKernelCommandLine=!cloud-init=disabled
18322d
+
18322d
+[Service]
18322d
+Type=oneshot
18322d
+ExecStart=/usr/bin/cloud-init modules --mode=final
18322d
+RemainAfterExit=yes
18322d
+TimeoutSec=0
18322d
+KillMode=process
18322d
+
18322d
+# Output needs to appear in instance console output
18322d
+StandardOutput=journal+console
18322d
+
18322d
+[Install]
8a7340
+WantedBy=cloud-init.target
18322d
diff --git a/rhel/systemd/cloud-init-local.service b/rhel/systemd/cloud-init-local.service
18322d
new file mode 100644
8a7340
index 0000000..8f9f6c9
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-init-local.service
18322d
@@ -0,0 +1,31 @@
18322d
+[Unit]
18322d
+Description=Initial cloud-init job (pre-networking)
18322d
+DefaultDependencies=no
18322d
+Wants=network-pre.target
18322d
+After=systemd-remount-fs.service
18322d
+Requires=dbus.socket
18322d
+After=dbus.socket
18322d
+Before=NetworkManager.service network.service
18322d
+Before=network-pre.target
18322d
+Before=shutdown.target
18322d
+Before=firewalld.target
18322d
+Conflicts=shutdown.target
18322d
+RequiresMountsFor=/var/lib/cloud
18322d
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
18322d
+ConditionKernelCommandLine=!cloud-init=disabled
18322d
+
18322d
+[Service]
18322d
+Type=oneshot
18322d
+ExecStartPre=/bin/mkdir -p /run/cloud-init
18322d
+ExecStartPre=/sbin/restorecon /run/cloud-init
18322d
+ExecStartPre=/usr/bin/touch /run/cloud-init/enabled
18322d
+ExecStart=/usr/bin/cloud-init init --local
18322d
+ExecStart=/bin/touch /run/cloud-init/network-config-ready
18322d
+RemainAfterExit=yes
18322d
+TimeoutSec=0
18322d
+
18322d
+# Output needs to appear in instance console output
18322d
+StandardOutput=journal+console
18322d
+
18322d
+[Install]
8a7340
+WantedBy=cloud-init.target
18322d
diff --git a/rhel/systemd/cloud-init.service b/rhel/systemd/cloud-init.service
18322d
new file mode 100644
8a7340
index 0000000..d0023a0
18322d
--- /dev/null
18322d
+++ b/rhel/systemd/cloud-init.service
18322d
@@ -0,0 +1,25 @@
18322d
+[Unit]
18322d
+Description=Initial cloud-init job (metadata service crawler)
18322d
+Wants=cloud-init-local.service
18322d
+Wants=sshd-keygen.service
18322d
+Wants=sshd.service
18322d
+After=cloud-init-local.service
18322d
+After=NetworkManager.service network.service
18322d
+Before=network-online.target
18322d
+Before=sshd-keygen.service
18322d
+Before=sshd.service
18322d
+Before=systemd-user-sessions.service
18322d
+ConditionPathExists=!/etc/cloud/cloud-init.disabled
18322d
+ConditionKernelCommandLine=!cloud-init=disabled
18322d
+
18322d
+[Service]
18322d
+Type=oneshot
18322d
+ExecStart=/usr/bin/cloud-init init
18322d
+RemainAfterExit=yes
18322d
+TimeoutSec=0
18322d
+
18322d
+# Output needs to appear in instance console output
18322d
+StandardOutput=journal+console
18322d
+
18322d
+[Install]
8a7340
+WantedBy=cloud-init.target
8a7340
diff --git a/rhel/systemd/cloud-init.target b/rhel/systemd/cloud-init.target
8a7340
new file mode 100644
8a7340
index 0000000..083c3b6
8a7340
--- /dev/null
8a7340
+++ b/rhel/systemd/cloud-init.target
8a7340
@@ -0,0 +1,7 @@
8a7340
+# cloud-init target is enabled by cloud-init-generator
8a7340
+# To disable it you can either:
8a7340
+#  a.) boot with kernel cmdline of 'cloud-init=disabled'
8a7340
+#  b.) touch a file /etc/cloud/cloud-init.disabled
8a7340
+[Unit]
8a7340
+Description=Cloud-init target
8a7340
+After=multi-user.target
18322d
diff --git a/setup.py b/setup.py
8a7340
index 01a67b9..b2ac9bb 100755
18322d
--- a/setup.py
18322d
+++ b/setup.py
8a7340
@@ -139,14 +139,6 @@ INITSYS_FILES = {
18322d
     'sysvinit_deb': [f for f in glob('sysvinit/debian/*') if is_f(f)],
18322d
     'sysvinit_openrc': [f for f in glob('sysvinit/gentoo/*') if is_f(f)],
18322d
     'sysvinit_suse': [f for f in glob('sysvinit/suse/*') if is_f(f)],
18322d
-    'systemd': [render_tmpl(f)
18322d
-                for f in (glob('systemd/*.tmpl') +
18322d
-                          glob('systemd/*.service') +
8a7340
-                          glob('systemd/*.target'))
8a7340
-                if (is_f(f) and not is_generator(f))],
8a7340
-    'systemd.generators': [
8a7340
-        render_tmpl(f, mode=0o755)
8a7340
-        for f in glob('systemd/*') if is_f(f) and is_generator(f)],
18322d
     'upstart': [f for f in glob('upstart/*') if is_f(f)],
18322d
 }
18322d
 INITSYS_ROOTS = {
8a7340
@@ -155,9 +147,6 @@ INITSYS_ROOTS = {
18322d
     'sysvinit_deb': 'etc/init.d',
18322d
     'sysvinit_openrc': 'etc/init.d',
18322d
     'sysvinit_suse': 'etc/init.d',
18322d
-    'systemd': pkg_config_read('systemd', 'systemdsystemunitdir'),
18322d
-    'systemd.generators': pkg_config_read('systemd',
18322d
-                                          'systemdsystemgeneratordir'),
18322d
     'upstart': 'etc/init/',
18322d
 }
18322d
 INITSYS_TYPES = sorted([f.partition(".")[0] for f in INITSYS_ROOTS.keys()])
8a7340
@@ -208,47 +197,6 @@ class MyEggInfo(egg_info):
18322d
         return ret
18322d
 
18322d
 
18322d
-# TODO: Is there a better way to do this??
18322d
-class InitsysInstallData(install):
18322d
-    init_system = None
18322d
-    user_options = install.user_options + [
18322d
-        # This will magically show up in member variable 'init_sys'
18322d
-        ('init-system=', None,
18322d
-         ('init system(s) to configure (%s) [default: None]' %
18322d
-          (", ".join(INITSYS_TYPES)))),
18322d
-    ]
18322d
-
18322d
-    def initialize_options(self):
18322d
-        install.initialize_options(self)
18322d
-        self.init_system = ""
18322d
-
18322d
-    def finalize_options(self):
18322d
-        install.finalize_options(self)
18322d
-
18322d
-        if self.init_system and isinstance(self.init_system, str):
18322d
-            self.init_system = self.init_system.split(",")
18322d
-
18322d
-        if len(self.init_system) == 0:
18322d
-            self.init_system = ['systemd']
18322d
-
18322d
-        bad = [f for f in self.init_system if f not in INITSYS_TYPES]
18322d
-        if len(bad) != 0:
18322d
-            raise DistutilsArgError(
18322d
-                "Invalid --init-system: %s" % (','.join(bad)))
18322d
-
18322d
-        for system in self.init_system:
18322d
-            # add data files for anything that starts with '<system>.'
18322d
-            datakeys = [k for k in INITSYS_ROOTS
18322d
-                        if k.partition(".")[0] == system]
18322d
-            for k in datakeys:
18322d
-                if not INITSYS_FILES[k]:
18322d
-                    continue
18322d
-                self.distribution.data_files.append(
18322d
-                    (INITSYS_ROOTS[k], INITSYS_FILES[k]))
18322d
-        # Force that command to reinitalize (with new file list)
18322d
-        self.distribution.reinitialize_command('install_data', True)
18322d
-
18322d
-
18322d
 if not in_virtualenv():
18322d
     USR = "/" + USR
18322d
     ETC = "/" + ETC
8a7340
@@ -258,14 +206,11 @@ if not in_virtualenv():
8a7340
         INITSYS_ROOTS[k] = "/" + INITSYS_ROOTS[k]
18322d
 
18322d
 data_files = [
18322d
-    (ETC + '/cloud', [render_tmpl("config/cloud.cfg.tmpl")]),
8a7340
+    (ETC + '/bash_completion.d', ['bash_completion/cloud-init']),
18322d
     (ETC + '/cloud/cloud.cfg.d', glob('config/cloud.cfg.d/*')),
18322d
     (ETC + '/cloud/templates', glob('templates/*')),
18322d
-    (USR_LIB_EXEC + '/cloud-init', ['tools/ds-identify',
18322d
-                                    'tools/uncloud-init',
18322d
+    (USR_LIB_EXEC + '/cloud-init', ['tools/uncloud-init',
18322d
                                     'tools/write-ssh-key-fingerprints']),
8a7340
-    (USR + '/share/bash-completion/completions',
8a7340
-     ['bash_completion/cloud-init']),
18322d
     (USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]),
18322d
     (USR + '/share/doc/cloud-init/examples',
8a7340
         [f for f in glob('doc/examples/*') if is_f(f)]),
8a7340
@@ -276,15 +221,8 @@ if os.uname()[0] != 'FreeBSD':
18322d
     data_files.extend([
18322d
         (ETC + '/NetworkManager/dispatcher.d/',
18322d
          ['tools/hook-network-manager']),
18322d
-        (ETC + '/dhcp/dhclient-exit-hooks.d/', ['tools/hook-dhclient']),
18322d
-        (LIB + '/udev/rules.d', [f for f in glob('udev/*.rules')])
18322d
+        ('/usr/lib/udev/rules.d', [f for f in glob('udev/*.rules')])
18322d
     ])
18322d
-# Use a subclass for install that handles
18322d
-# adding on the right init system configuration files
18322d
-cmdclass = {
18322d
-    'install': InitsysInstallData,
18322d
-    'egg_info': MyEggInfo,
18322d
-}
18322d
 
18322d
 requirements = read_requires()
18322d
 
8a7340
@@ -299,8 +237,6 @@ setuptools.setup(
18322d
     scripts=['tools/cloud-init-per'],
18322d
     license='Dual-licensed under GPLv3 or Apache 2.0',
18322d
     data_files=data_files,
18322d
-    install_requires=requirements,
18322d
-    cmdclass=cmdclass,
18322d
     entry_points={
18322d
         'console_scripts': [
18322d
             'cloud-init = cloudinit.cmd.main:main',
18322d
diff --git a/tools/read-version b/tools/read-version
8a7340
index 6dca659..d43cc8f 100755
18322d
--- a/tools/read-version
18322d
+++ b/tools/read-version
8a7340
@@ -65,32 +65,8 @@ output_json = '--json' in sys.argv
18322d
 src_version = ci_version.version_string()
18322d
 version_long = None
18322d
 
18322d
-if is_gitdir(_tdir) and which("git"):
18322d
-    flags = []
18322d
-    if use_tags:
18322d
-        flags = ['--tags']
18322d
-    cmd = ['git', 'describe', '--abbrev=8', '--match=[0-9]*'] + flags
18322d
-
8a7340
-    try:
8a7340
-        version = tiny_p(cmd).strip()
8a7340
-    except RuntimeError:
8a7340
-        version = None
18322d
-
8a7340
-    if version is None or not version.startswith(src_version):
18322d
-        sys.stderr.write("git describe version (%s) differs from "
18322d
-                         "cloudinit.version (%s)\n" % (version, src_version))
18322d
-        sys.stderr.write(
18322d
-            "Please get the latest upstream tags.\n"
18322d
-            "As an example, this can be done with the following:\n"
18322d
-            "$ git remote add upstream https://git.launchpad.net/cloud-init\n"
18322d
-            "$ git fetch upstream --tags\n"
18322d
-        )
18322d
-        sys.exit(1)
18322d
-
18322d
-    version_long = tiny_p(cmd + ["--long"]).strip()
18322d
-else:
18322d
-    version = src_version
18322d
-    version_long = None
18322d
+version = src_version
18322d
+version_long = None
18322d
 
18322d
 # version is X.Y.Z[+xxx.gHASH]
18322d
 # version_long is None or X.Y.Z-xxx-gHASH
18322d
-- 
8a7340
1.8.3.1
18322d