Skip to content

Instantly share code, notes, and snippets.

View sjmh's full-sized avatar

steven 'haji' hajducko sjmh

View GitHub Profile
@sjmh
sjmh / vmhgfs-d_count-kernel-3.10-tools-9.6.2.patch
Last active August 29, 2015 14:19
VMware Tools hgfs patch for RHEL6 kernel 3.10.0-123
--- inode.c 2014-03-21 15:37:16.000000000 -0700
+++ inode.c-new 2014-07-17 14:20:50.202233706 -0700
@@ -31,6 +31,9 @@
#include <linux/namei.h>
#endif
#include <linux/highmem.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+#include <linux/dcache.h>
+#endif
master:
- master1
- master2
-
- master3a
- master3b
- master4
sks_build:
cmd.run:
- name: /usr/sbin/sks build {{ sks.datadir }}/dump/*.pgp -n 2 -cache 50
- creates: {{ sks.datadir }}/DB/key
- user: {{ sks.user }}
- require:
- pkg: sks
sks_build_done:
file.exists:
[root@alpha pillar]# pwd
/srv/pillar
[root@alpha pillar]# ls
cobbler.sls quickbase.sls top.sls
[root@alpha pillar]# cat top.sls
base:
'alpha':
- quickbase
'steve':
- cobbler
cmd.run:
salt.function:
- tgt: 'alpha'
- arg:
- 'ls -l /tmp'
- require:
- salt: test
test:
salt.function:
opts = salt.config.master_config('/etc/salt/master')
opts['quiet'] = True
r = salt.runner.RunnerClient(opts)
Here's the code from an execution module:
try:
return client.watch(key, recurse=recurse, wait=True, timeout=timeout, index=index)
except urllib3.exceptions.ReadTimeoutError as e:
return 'got timeout'
except Exception as e:
return str(type(e))
When it runs:
# -*- coding: utf-8 -*-
'''
SCSI administration module
'''
from __future__ import absolute_import
import os.path
import logging
log = logging.getLogger(__name__)
import distutils.sysconfig
import sys
import salt.client
plib = distutils.sysconfig.get_python_lib()
mod_path = '{0}/cobbler'.format(plib)
sys.path.insert(0, mod_path)
def register():
import distutils.sysconfig
import sys
import salt.client
plib = distutils.sysconfig.get_python_lib()
mod_path = '{0}/cobbler'.format(plib)
sys.path.insert(0, mod_path)
def register():