canonical / canonical/cloud-init
Chef omnibus installer on CentOS broken
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 22
Description
This bug was originally filed in Launchpad as [LP: #1385860](https://bugs.launchpad.net/cloud-init/+bug/1385860)
Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2014-10-26T12:15:31.782077+00:00
date_fix_committed = None
date_fix_released = None
id = 1385860
importance = medium
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1385860
milestone = None
owner = 4-contact-t
owner_name = Jura Berg
private = False
status = confirmed
submitter = 4-contact-t
submitter_name = Jura Berg
tags = ['centos', 'chef']
duplicates = []
_Launchpad user **Jura Berg(4-contact-t)** wrote on 2014-10-26T12:15:31.782077+00:00_
Omnibus installer fails on CentOS:
- util.py[WARNING]: Running cc_chef () failed
- cloud-init[WARNING]: Ran cc_chef but it failed!
The reason is that /var/run/chef is symlink to /run/chef and ensure_dir() fails on selinux.restorecon(). Quick fix would be:
--- cloud-init-0.7.6/cloudinit/util.py 2014-10-10 18:26:25.000000000 +0300
+++ /root/cloud-init-0.7.6/cloudinit/util.py 2014-10-26 14:16:01.022089307 +0200
@@ -160,7 +160,10 @@
LOG.debug("Restoring selinux mode for %s (recursive=%s)",
path, self.recursive)
- self.selinux.restorecon(path, recursive=self.recursive)
+ try:
+ self.selinux.restorecon(path, recursive=self.recursive)
+ except OSError:
+ return
Contributor guide
Research direction
Start in cloudinit/util.py at ensure_dir and trace its use from cloudinit.config.cc_chef. Reproduce the CentOS Chef omnibus installer failure and verify that the cc_chef path completes successfully when /var/run/chef is a symlink and SELinux restoration raises OSError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- Half a day
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100