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