From 2f65612b71870e7dc76eb63a07fceb2da2a2f3af Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 4 Feb 2015 14:06:52 -0500 Subject: [PATCH 1/3] Removing the confluent_xcat subdirectory After some discussion with the team, let's keep the xcat related "glue" out of the confluent project, for now. This will give me more time to figure out how things will come together and integrate for xCAT3. For xCAT2, a xCAT-confluent RPM is added to xcat-core project to be consistent with how xCAT2 is packaged today. --- confluent_xcat/MANIFEST.in | 1 - confluent_xcat/Makefile | 32 --------------- confluent_xcat/README.txt | 1 - confluent_xcat/VERSION | 1 - confluent_xcat/buildrpm | 1 - .../confluent/plugins/console/xcathmc.sh | 2 - confluent_xcat/confluent_xcat.spec.tmpl | 41 ------------------- confluent_xcat/makesetup | 1 - confluent_xcat/requirements.txt | 1 - confluent_xcat/setup.cfg | 18 -------- confluent_xcat/setup.py.tmpl | 14 ------- 11 files changed, 113 deletions(-) delete mode 100644 confluent_xcat/MANIFEST.in delete mode 100644 confluent_xcat/Makefile delete mode 100644 confluent_xcat/README.txt delete mode 100644 confluent_xcat/VERSION delete mode 120000 confluent_xcat/buildrpm delete mode 100755 confluent_xcat/confluent/plugins/console/xcathmc.sh delete mode 100644 confluent_xcat/confluent_xcat.spec.tmpl delete mode 120000 confluent_xcat/makesetup delete mode 100644 confluent_xcat/requirements.txt delete mode 100644 confluent_xcat/setup.cfg delete mode 100644 confluent_xcat/setup.py.tmpl diff --git a/confluent_xcat/MANIFEST.in b/confluent_xcat/MANIFEST.in deleted file mode 100644 index 67b65344..00000000 --- a/confluent_xcat/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include confluent/plugins/console/* diff --git a/confluent_xcat/Makefile b/confluent_xcat/Makefile deleted file mode 100644 index 737ddd04..00000000 --- a/confluent_xcat/Makefile +++ /dev/null @@ -1,32 +0,0 @@ - -PKGNAME=confluent_xcat -VERNUM=`cat VERSION` - -all: clean prepare confluent_xcat - -prepare: - @echo [${PKGNAME}] preparing... - mkdir -p rpmbuild/BUILD - mkdir -p rpmbuild/BUILDROOT - mkdir -p rpmbuild/RPMS - mkdir -p rpmbuild/SOURCES - mkdir -p rpmbuild/SPECS - mkdir -p rpmbuild/SRPMS - - -confluent_xcat: - @echo [${PKGNAME}] building... - sed -e "s/#VERSION#/${VERNUM}/" setup.py.tmpl > setup.py - python setup.py sdist > /dev/null 2>&1 - cp dist/*.tar.gz rpmbuild/SOURCES - sed -e "s/#VERSION#/${VERNUM}/" ${PKGNAME}.spec.tmpl > rpmbuild/SPECS/${PKGNAME}.spec - rpmbuild -ba rpmbuild/SPECS/${PKGNAME}.spec - -clean: - @echo [${PKGNAME}] cleaning... - rm -rf rpmbuild - rm -f setup.py - rm -rf ${PKGNAME}.egg-info - rm -rf dist - - diff --git a/confluent_xcat/README.txt b/confluent_xcat/README.txt deleted file mode 100644 index d34e2f87..00000000 --- a/confluent_xcat/README.txt +++ /dev/null @@ -1 +0,0 @@ -xCAT integration with confluent systems management server diff --git a/confluent_xcat/VERSION b/confluent_xcat/VERSION deleted file mode 100644 index d3827e75..00000000 --- a/confluent_xcat/VERSION +++ /dev/null @@ -1 +0,0 @@ -1.0 diff --git a/confluent_xcat/buildrpm b/confluent_xcat/buildrpm deleted file mode 120000 index e3ac8f68..00000000 --- a/confluent_xcat/buildrpm +++ /dev/null @@ -1 +0,0 @@ -../confluent_server/buildrpm \ No newline at end of file diff --git a/confluent_xcat/confluent/plugins/console/xcathmc.sh b/confluent_xcat/confluent/plugins/console/xcathmc.sh deleted file mode 100755 index 5b3a3cc6..00000000 --- a/confluent_xcat/confluent/plugins/console/xcathmc.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exec /opt/xcat/share/xcat/cons/hmc $CONFLUENT_NODE diff --git a/confluent_xcat/confluent_xcat.spec.tmpl b/confluent_xcat/confluent_xcat.spec.tmpl deleted file mode 100644 index 940a20b0..00000000 --- a/confluent_xcat/confluent_xcat.spec.tmpl +++ /dev/null @@ -1,41 +0,0 @@ -%define name confluent_xcat -%define version #VERSION# -%define release 1 - -Summary: xCAT integration with confluent systems management server -Name: %{name} -Version: %{version} -Release: %{release} -Source0: %{name}-%{version}.tar.gz -License: Apache2 -Group: Development/Libraries -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot -Prefix: %{_prefix} -BuildArch: noarch -Requires: confluent_server -Vendor: Victor Hu -Url: http://xcat.sf.net/ - -%description -xCAT integration with confluent system management server - -%prep -%setup -n %{name}-%{version} -n %{name}-%{version} - -%build -python setup.py build - -%install -python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES.bare --install-purelib=/opt/xcat/lib/python --install-scripts=/opt/xcat/bin -for file in $(grep xcat/__init__.py INSTALLED_FILES.bare); do - rm $RPM_BUILD_ROOT/$file -done -grep -v xcat/__init__.py INSTALLED_FILES.bare > INSTALLED_FILES -cat INSTALLED_FILES - - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -f INSTALLED_FILES -%defattr(-,root,root) diff --git a/confluent_xcat/makesetup b/confluent_xcat/makesetup deleted file mode 120000 index 4930d195..00000000 --- a/confluent_xcat/makesetup +++ /dev/null @@ -1 +0,0 @@ -../confluent_server/makesetup \ No newline at end of file diff --git a/confluent_xcat/requirements.txt b/confluent_xcat/requirements.txt deleted file mode 100644 index b761cf7b..00000000 --- a/confluent_xcat/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -confluent_server>=0.1 diff --git a/confluent_xcat/setup.cfg b/confluent_xcat/setup.cfg deleted file mode 100644 index 9010fbb0..00000000 --- a/confluent_xcat/setup.cfg +++ /dev/null @@ -1,18 +0,0 @@ -[metadata] -name = confluent_xcat -summary = xCAT integration with confluent systems management server -description-file = - README.txt -author = Victor Hu -author-email = vhu@us.ibm.com -home-page = http://xcat.sf.net/ -classifier = - Intended Audience :: Information Technology - Intended Audience :: System Administrators - License :: OSI Approved :: Apache Software License - Operating System :: POSIX :: Linux - Programming Language :: Python :: 2.6 - Programming Language :: Python :: 2.7 - -[files] -packages = diff --git a/confluent_xcat/setup.py.tmpl b/confluent_xcat/setup.py.tmpl deleted file mode 100644 index 98feda74..00000000 --- a/confluent_xcat/setup.py.tmpl +++ /dev/null @@ -1,14 +0,0 @@ -from setuptools import setup -import os - -setup( - name='confluent_xcat', - version='#VERSION#', - author='Victor Hu', - author_email='vhu@us.ibm.com', - url='http://xcat.sf.net/', - description='xCAT integration with confluent systems management server', - #packages=['xcat'], - install_requires=['confluent_server > 1.0.0'], - data_files=[('/opt/confluent/lib/python/confluent/plugins/console/', ['confluent/plugins/console/xcathmc.sh'])], -) From 3756ee129aac45842023b9c707e771d94a68390d Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 10 Feb 2015 17:16:10 -0500 Subject: [PATCH 2/3] Checking for ppc64 and setting the SO_PEERCRED to 21. The socket.SO_PEERCRED seemed to work fine for my ppc64 RHEL system, but testing today on little- endian SLES 12 system threw that exception. So checking if the arch is "ppc64" on the exception case. --- confluent_server/confluent/sockapi.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/confluent_server/confluent/sockapi.py b/confluent_server/confluent/sockapi.py index ee872100..3d02eab8 100644 --- a/confluent_server/confluent/sockapi.py +++ b/confluent_server/confluent/sockapi.py @@ -45,7 +45,11 @@ auditlog = None try: SO_PEERCRED = socket.SO_PEERCRED except AttributeError: - SO_PEERCRED = 17 + import platform + if "ppc64" in platform.machine(): + SO_PEERCRED = 21 + else: + SO_PEERCRED = 17 class ClientConsole(object): From 1f7a0e77d6e72783ae1842f748caa0211c2f6e9f Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 10 Feb 2015 17:18:16 -0500 Subject: [PATCH 3/3] On SLES operating systems, hit an error on the shutdown of confluent when we call tcgetattr() with the following: termios.error: (25, 'Inappropriate ioctl for device') Before calling tcgetattr, check that the file descriptor is a tty. --- confluent_client/bin/confetty | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index be67260f..0a558e94 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -71,7 +71,10 @@ import confluent.client as client conserversequence = '\x05c' # ctrl-e, c -oldtcattr = termios.tcgetattr(sys.stdin.fileno()) +oldtcattr = None +fd = sys.stdin +if fd.isatty(): + oldtcattr = termios.tcgetattr(fd.fileno()) netserver = None laststate = {} @@ -469,7 +472,8 @@ def quitconfetty(code=0, fullexit=False, fixterm=True): if fixterm or didconsole: currfl = fcntl.fcntl(sys.stdin.fileno(), fcntl.F_GETFL) fcntl.fcntl(sys.stdin.fileno(), fcntl.F_SETFL, currfl ^ os.O_NONBLOCK) - termios.tcsetattr(sys.stdin.fileno(), termios.TCSANOW, oldtcattr) + if oldtcattr is not None: + termios.tcsetattr(sys.stdin.fileno(), termios.TCSANOW, oldtcattr) if fullexit: sys.exit(code) else: @@ -596,6 +600,7 @@ elif shellargs: command = " ".join(shellargs) do_command(command, netserver) quitconfetty(fullexit=True, fixterm=False) + while inconsole or not doexit: if inconsole: rdylist, _, _ = select.select(