Merge remote-tracking branch 'telmich/master'
This commit is contained in:
commit
27b9e1ba6c
6 changed files with 47 additions and 19 deletions
|
@ -22,10 +22,19 @@
|
||||||
|
|
||||||
# FIXME: other system types (not linux ...)
|
# FIXME: other system types (not linux ...)
|
||||||
|
|
||||||
|
os=$("$__explorer/os")
|
||||||
|
case "$os" in
|
||||||
|
"macosx")
|
||||||
|
echo "$(sysctl -n hw.physicalcpu)"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
if [ -r /proc/cpuinfo ]; then
|
if [ -r /proc/cpuinfo ]; then
|
||||||
cores="$(cat /proc/cpuinfo | grep "core id" | sort | uniq | wc -l)"
|
cores="$(grep "core id" /proc/cpuinfo | sort | uniq | wc -l)"
|
||||||
if [ ${cores} -eq 0 ]; then
|
if [ ${cores} -eq 0 ]; then
|
||||||
cores="1"
|
cores="1"
|
||||||
fi
|
fi
|
||||||
echo "${cores}"
|
echo "$cores"
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
@ -22,10 +22,19 @@
|
||||||
|
|
||||||
# FIXME: other system types (not linux ...)
|
# FIXME: other system types (not linux ...)
|
||||||
|
|
||||||
|
os=$("$__explorer/os")
|
||||||
|
case "$os" in
|
||||||
|
"macosx")
|
||||||
|
echo "$(system_profiler SPHardwareDataType | grep "Number of Processors" | awk -F': ' '{print $2}')"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
if [ -r /proc/cpuinfo ]; then
|
if [ -r /proc/cpuinfo ]; then
|
||||||
sockets="$(cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l)"
|
sockets="$(grep "physical id" /proc/cpuinfo | sort | uniq | wc -l)"
|
||||||
if [ ${sockets} -eq 0 ]; then
|
if [ ${sockets} -eq 0 ]; then
|
||||||
sockets="$(cat /proc/cpuinfo | grep "processor" | wc -l)"
|
sockets="$(cat /proc/cpuinfo | grep "processor" | wc -l)"
|
||||||
fi
|
fi
|
||||||
echo "${sockets}"
|
echo "${sockets}"
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
@ -22,6 +22,15 @@
|
||||||
|
|
||||||
# FIXME: other system types (not linux ...)
|
# FIXME: other system types (not linux ...)
|
||||||
|
|
||||||
|
os=$("$__explorer/os")
|
||||||
|
case "$os" in
|
||||||
|
"macosx")
|
||||||
|
echo "$(sysctl -n hw.memsize)/1024" | bc
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
if [ -r /proc/meminfo ]; then
|
if [ -r /proc/meminfo ]; then
|
||||||
echo "$(cat /proc/meminfo | grep "MemTotal:" | awk '{print $2}')"
|
grep "MemTotal:" /proc/meminfo | awk '{print $2}'
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
|
@ -144,4 +144,4 @@ class Manifest(object):
|
||||||
type_manifest = os.path.join(self.local.type_path, cdist_object.cdist_type.manifest_path)
|
type_manifest = os.path.join(self.local.type_path, cdist_object.cdist_type.manifest_path)
|
||||||
message_prefix = cdist_object.name
|
message_prefix = cdist_object.name
|
||||||
if os.path.isfile(type_manifest):
|
if os.path.isfile(type_manifest):
|
||||||
self.local.run_script(type_manifest, env=self.env_type_manifest(cdist_object))
|
self.local.run_script(type_manifest, env=self.env_type_manifest(cdist_object), message_prefix=message_prefix)
|
||||||
|
|
|
@ -7,6 +7,7 @@ Changelog
|
||||||
|
|
||||||
3.1.7:
|
3.1.7:
|
||||||
* Type __cdistmarker: Fix typo (Ricardo Catalinas Jiménez)
|
* Type __cdistmarker: Fix typo (Ricardo Catalinas Jiménez)
|
||||||
|
* Core: Bugfix: Export messaging to manifests (Ricardo Catalinas Jiménez)
|
||||||
|
|
||||||
3.1.6: 2014-08-18
|
3.1.6: 2014-08-18
|
||||||
* New Type: __ssh_dot_ssh
|
* New Type: __ssh_dot_ssh
|
||||||
|
|
|
@ -203,10 +203,10 @@ __global::
|
||||||
Directory that contains generic output like explorer.
|
Directory that contains generic output like explorer.
|
||||||
Available for: initial manifest, type manifest, type gencode, shell
|
Available for: initial manifest, type manifest, type gencode, shell
|
||||||
__messages_in::
|
__messages_in::
|
||||||
File to read messages from
|
File to read messages from.
|
||||||
Available for: initial manifest, type manifest, type gencode
|
Available for: initial manifest, type manifest, type gencode
|
||||||
__messages_out::
|
__messages_out::
|
||||||
File to write messages
|
File to write messages.
|
||||||
Available for: initial manifest, type manifest, type gencode
|
Available for: initial manifest, type manifest, type gencode
|
||||||
__object::
|
__object::
|
||||||
Directory that contains the current object.
|
Directory that contains the current object.
|
||||||
|
|
Loading…
Reference in a new issue