redhat-cip / edeploy

Linux systems provisioning and updating made easy
Apache License 2.0
92 stars 38 forks source link

openstack/common: Disable package even when enable isnt the first keyword #130

Closed Spredzy closed 10 years ago

Spredzy commented 10 years ago

Currently, services are disabled only if enable or disable is the first keywork in the systemctl command. For example :

  systemctl enable myservice.service

Unfortunately, enable or disable isn't always the first word. For example, Puppet enable its service with this command :

  systemctl --no-reload enable puppet.service

Hence the current script does not work anymore. This patch makes the install_packages_disabled works no matter where is the enable keyword located.

ErwanAliasr1 commented 10 years ago

I do think that could fail if the package name is containing "enable" or "disable" isn't it ?

Spredzy commented 10 years ago

Sorry @ErwanAliasr1 I just noticed your message. I saw about that and that's why it greps '(enable|disable) ', not the extra space at the end.

Since systemctl should call something like systemctl (enable|disable) myservice.service even if the service is called enable.service it wouldn't match