Skip to content

Instantly share code, notes, and snippets.

@jonyesno
Created September 27, 2013 02:52
Show Gist options
  • Save jonyesno/6723571 to your computer and use it in GitHub Desktop.
Save jonyesno/6723571 to your computer and use it in GitHub Desktop.
Cobbler's linkfile uses various device-based checks that fail inside LXC. This patch disables them.
--- /usr/lib/python2.6/site-packages/cobbler/utils.py- 2013-06-20 01:42:48.000000000 -0400
+++ /usr/lib/python2.6/site-packages/cobbler/utils.py 2013-09-26 22:51:42.000000000 -0400
@@ -1168,13 +1168,15 @@
# arg
raise "Internal error: API handle is required"
- is_remote = is_remote_file(src)
+ logger.info('skipping is_remote_file, is_safe_to_hardlink checks')
+ is_remote = False
+ # is_remote = is_remote_file(src)
if os.path.exists(dst):
# if the destination exists, is it right in terms of accuracy
# and context?
if os.path.samefile(src, dst):
- if not is_safe_to_hardlink(src,dst,api):
+ if False: # not is_safe_to_hardlink(src,dst,api):
# may have to remove old hardlinks for SELinux reasons
# as previous implementations were not complete
if logger is not None:
@@ -1188,7 +1190,7 @@
logger.info("removing: %s" % dst)
os.remove(dst)
- if is_safe_to_hardlink(src,dst,api):
+ if True: # is_safe_to_hardlink(src,dst,api):
# we can try a hardlink if the destination isn't to NFS or Samba
# this will help save space and sync time.
try:
@jonyesno
Copy link
Author

cobbler-2.4.0-1.el6.noarch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment