diff options
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -92,26 +92,36 @@ class InitsysInstallData(install): user_options = install.user_options + [ # This will magically show up in member variable 'init_sys' ('init-system=', None, - ('init system to configure (%s) [default: None]') % + ('init system(s) to configure (%s) [default: None]') % (", ".join(INITSYS_TYPES)) ), ] def initialize_options(self): install.initialize_options(self) - self.init_system = None + self.init_system = "" def finalize_options(self): install.finalize_options(self) - if self.init_system and self.init_system not in INITSYS_TYPES: + + if self.init_system and isinstance(self.init_system, str): + self.init_system = self.init_system.split(",") + + if len(self.init_system) == 0: raise DistutilsArgError(("You must specify one of (%s) when" - " specifying a init system!") % (", ".join(INITSYS_TYPES))) - elif self.init_system: + " specifying init system(s)!") % (", ".join(INITSYS_TYPES))) + + bad = [f for f in self.init_system if f not in INITSYS_TYPES] + if len(bad) != 0: + raise DistutilsArgError( + "Invalid --init-system: %s" % (','.join(bad))) + + for sys in self.init_system: + print("adding %s: %s" % (sys, str(INITSYS_ROOTS[sys]))) self.distribution.data_files.append( - (INITSYS_ROOTS[self.init_system], - INITSYS_FILES[self.init_system])) - # Force that command to reinitalize (with new file list) - self.distribution.reinitialize_command('install_data', True) + (INITSYS_ROOTS[sys], INITSYS_FILES[sys])) + # Force that command to reinitalize (with new file list) + self.distribution.reinitialize_command('install_data', True) setuptools.setup(name='cloud-init', |