Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Simplify python ctypes detection
Browse files Browse the repository at this point in the history
  • Loading branch information
NarineM authored and lagalbra committed May 23, 2017
1 parent 222ad1e commit 77a90ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/OMS-Agent-for-Linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The OMS agent for Linux is provided in a self-extracting and installable shell s
**Installing the agent**

1. Transfer the appropriate bundle (x86 or x64) to your Linux computer, using scp/sftp.
2. Install the bundle by using the `--install` or `--upgrade` argument. Note: use the `--upgrade` argument if any existing packages are installed, as would be the case if the system Center Operations Manager agent for Linux is already installed. To onboard to Operations Management Suite during installation, provide the `-w <WorkspaceID>` and `-s <Shared Key>` parameters.
2. Install the bundle by using the `--install` or `--upgrade` argument. Note: must use the `--upgrade` argument if any dependent packages such as omi, scx, omsconfig or their older versions are installed, as would be the case if the system Center Operations Manager agent for Linux is already installed. To onboard to Operations Management Suite during installation, provide the `-w <WorkspaceID>` and `-s <Shared Key>` parameters.

**To install and onboard directly:**
```
Expand Down
17 changes: 2 additions & 15 deletions installer/bundle/bundle_skel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -370,21 +370,8 @@ python_ctypes_installed() {
# Check for Python ctypes library (required for omsconfig)
hasCtypes=1
echo "Checking for ctypes python module ..."

# Check #1: Attempt to create and execute a temporary file importing ctypes
tempFile=`mktemp`

cat <<EOF > $tempFile
#! /usr/bin/python
import ctypes
EOF

chmod u+x $tempFile
$tempFile 1> /dev/null 2> /dev/null
[ $? -eq 0 ] && hasCtypes=0
rm $tempFile

# Check #2: Attempt to run python with the single import command

# Attempt to run python with the single import command
python -c "import ctypes" 1> /dev/null 2> /dev/null
[ $? -eq 0 ] && hasCtypes=0

Expand Down

0 comments on commit 77a90ff

Please sign in to comment.