2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-29 16:50:57 +00:00

Compare commits

...

10 Commits

Author SHA1 Message Date
Jarrod Johnson e28d6f1ec9 Remove 'path' condition for session cookie
The cookie had an unnecessary limitation.  path need not be specified,
and it is possible for a client to request in a way that fails the criteria.
2016-10-21 09:57:44 -04:00
Jarrod Johnson f2b379ea01 Fix auto-version build
The build autoversion was not correct.  Use
git describe instead to be more complete.
2016-09-30 13:13:20 -04:00
Jarrod Johnson 3f272d2d53 Merge branch 'fixhelp' into v1_3 2016-09-30 13:07:41 -04:00
Jarrod Johnson d8bf4742f7 Fix missing -h and inconsistant usage
A number of confluent commands would not react sanely to
-h.  Fix this for all the confluent client commands.
2016-09-30 13:05:24 -04:00
Amanda Duffy 13016b6dd8 Add exception check if passvalues is empty 2016-09-23 10:58:56 -04:00
Jarrod Johnson 99829835e7 Defer console startup until after API startup
Consoles starting up would potentially delay API availaility.  Change
by having the API having ample time to startup, then commence the
busy work of starting cnosole sessions.
2016-09-13 11:34:10 -04:00
Jarrod Johnson ad69ce909e Avoid double-disconnect behavior
Do a better job of cleanly handling scenarios
where disconnect would come from a session currently
disconnected.  Inside the ipmi plugin, suppress a
disconnect event if one has been sent.  Inside
consoleserver, surpress logging a disconnect when
already disconnected.

Originally was going to skip the reconnect, but that would
mitigate recovery.  Hopefully supressing the duplicate
disconnect in ipmi plugin, and some fixes in pyghmi will
avoid a 'double connect' scenario.
2016-09-12 14:37:41 -04:00
Jarrod Johnson a52ca8cea5 Fix nodeeventlog with 'None' entries
Some entries have 'None' fields.  Gracefully tolerate
this scenario.
2016-09-09 09:15:11 -04:00
Jarrod Johnson 73d74bae3e Fix 'unset' on noderange
The Attributes management class was making shared shallow
copies.  This caused a problem when attributes class assumed
it could modify the result.  Correct by providing a deep copy
of that node's data when it is requested.
2016-07-14 12:51:59 -04:00
Jarrod Johnson c5a0564d41 Fix 'cd' to /noderange/nr in confetty
The cd performance optimization caused a problem.  This
commit recognizes /noderange/ as special auto-vivifying
directory that must be 'gotten'.
2016-07-14 12:51:52 -04:00
11 changed files with 79 additions and 43 deletions
+18 -9
View File
@@ -16,6 +16,7 @@
# limitations under the License.
from datetime import datetime as dt
import optparse
import os
import sys
@@ -26,19 +27,23 @@ if path.startswith('/opt'):
import confluent.client as client
argparser = optparse.OptionParser(
usage="Usage: %prog [options] noderange [clear]")
(options, args) = argparser.parse_args()
try:
noderange = sys.argv[1]
noderange = args[0]
except IndexError:
sys.stderr.write(
'Usage: {0} <noderange> [clear]\n'.format(
sys.argv[0]))
argparser.print_usage()
sys.exit(1)
deletemode = False
if len(sys.argv) == 3:
if sys.argv[2] == 'clear':
if len(args) == 2:
if args[1] == 'clear':
deletemode = True
else:
argparser.print_usage()
sys.exit(1)
session = client.Command()
exitcode = 0
@@ -81,6 +86,10 @@ for rsp in func('/noderange/{0}/events/hardware/log'.format(noderange)):
sys.stderr.write('{0}: {1}\n'.format(node, thisdata['error']))
exitcode |= 1
if 'events' in thisdata:
evtdata = thisdata['events']
for evt in evtdata:
print '{0}: {1}'.format(node, format_event(evt))
evtdata = thisdata['events']
for evt in evtdata:
try:
print('{0}: {1}'.format(node, format_event(evt)))
except IOError:
sys.exit(0)
+6 -4
View File
@@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import optparse
import os
import sys
path = os.path.dirname(os.path.realpath(__file__))
@@ -24,6 +25,9 @@ if path.startswith('/opt'):
import confluent.client as client
argparser = optparse.OptionParser(
usage="Usage: %prog [options] noderange")
(options, args) = argparser.parse_args()
exitcode = 0
@@ -58,11 +62,9 @@ def printfirm(node, prefix, data):
try:
noderange = sys.argv[1]
noderange = args[0]
except IndexError:
sys.stderr.write(
'Usage: {0} <noderange>\n'.format(
sys.argv[0]))
argparser.print_usage()
sys.exit(1)
try:
session = client.Command()
+7 -2
View File
@@ -16,6 +16,7 @@
# limitations under the License.
import codecs
import optparse
import os
import sys
@@ -26,12 +27,16 @@ if path.startswith('/opt'):
import confluent.client as client
argparser = optparse.OptionParser(
usage="Usage: %prog [options] noderange")
(options, args) = argparser.parse_args()
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
try:
noderange = sys.argv[1]
noderange = args[0]
except IndexError:
sys.stderr.write('Usage: {0} <noderange>\n'.format(sys.argv[0]))
argparser.print_usage()
sys.exit(1)
+12 -4
View File
@@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import optparse
import os
import sys
@@ -25,15 +26,22 @@ if path.startswith('/opt'):
import confluent.client as client
argparser = optparse.OptionParser(
usage="Usage: %prog [options] noderange [on|off]")
(options, args) = argparser.parse_args()
try:
noderange = sys.argv[1]
noderange = args[0]
except IndexError:
sys.stderr.write('Usage: {0} <noderange> [on|off]\n'.format(sys.argv[0]))
argparser.print_usage()
sys.exit(1)
identifystate = None
if len(sys.argv) > 2:
identifystate = sys.argv[2]
if len(args) > 1:
identifystate = args[1]
if identifystate not in ('on', 'off'):
argparser.print_usage()
sys.exit(1)
session = client.Command()
exitcode = 0
sys.exit(
+6 -4
View File
@@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import optparse
import os
import sys
path = os.path.dirname(os.path.realpath(__file__))
@@ -24,6 +25,9 @@ if path.startswith('/opt'):
import confluent.client as client
argparser = optparse.OptionParser(
usage="Usage: %prog [options] noderange")
(options, args) = argparser.parse_args()
def pretty(text):
if text == 'pcislot':
@@ -70,11 +74,9 @@ def printerror(res, node=None):
try:
noderange = sys.argv[1]
noderange = args[0]
except IndexError:
sys.stderr.write(
'Usage: {0} <noderange>\n'.format(
sys.argv[0]))
argparser.print_usage()
sys.exit(1)
try:
session = client.Command()
+1 -1
View File
@@ -42,7 +42,7 @@ def attrrequested(attr, attrlist, seenattributes):
return True
return False
argparser = optparse.OptionParser(
usage="Usage: %prog [options] noderange [list of attributes")
usage="Usage: %prog [options] noderange [attributes...]")
argparser.add_option('-b', '--blame', action='store_true',
help='Show information about how attributes inherited')
(options, args) = argparser.parse_args()
+14 -7
View File
@@ -15,9 +15,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import optparse
import os
import sys
valid_states = ('on', 'off', 'boot', 'reset', 'shutdown')
path = os.path.dirname(os.path.realpath(__file__))
path = os.path.realpath(os.path.join(path, '..', 'lib', 'python'))
if path.startswith('/opt'):
@@ -25,21 +27,26 @@ if path.startswith('/opt'):
import confluent.client as client
argparser = optparse.OptionParser(
usage="Usage: %prog [options] noderange [{0}]".format(
'|'.join(valid_states)))
(options, args) = argparser.parse_args()
try:
noderange = sys.argv[1]
noderange = args[0]
except IndexError:
sys.stderr.write(
'Usage: {0} <noderange> ([status|on|off|shutdown|boot|reset]\n'.format(
sys.argv[0]))
argparser.print_usage()
sys.exit(1)
setstate = None
if len(sys.argv) > 2:
if len(args) > 1:
if not args[1] in ('stat', 'state', 'status'):
setstate = args[1]
if setstate == 'softoff':
setstate = 'shutdown'
elif not sys.argv[2] in ('stat', 'state', 'status'):
setstate = sys.argv[2]
if setstate is not None and setstate not in valid_states:
argparser.print_usage()
sys.exit(1)
session = client.Command()
exitcode = 0
+1 -1
View File
@@ -39,7 +39,7 @@ sensorcollections = {
argparser = optparse.OptionParser(
usage="Usage: %prog [options] noderange [sensor(s)")
usage="Usage: %prog [options] noderange [sensor(s)]")
argparser.add_option('-i', '--interval', type='int',
help='Interval to do repeated samples over')
argparser.add_option('-n', '--numreadings', type='int',
+10 -6
View File
@@ -26,7 +26,10 @@ if path.startswith('/opt'):
import confluent.client as client
argparser = optparse.OptionParser()
valid_targets = ('default', 'network', 'cd', 'setup', 'hd')
argparser = optparse.OptionParser(
usage="Usage: %prog [options] noderange [{0}]".format(
'|'.join(valid_targets)))
argparser.add_option('-b', '--bios', dest='biosmode',
action='store_true', default=False,
help='Request BIOS style boot (rather than UEFI)')
@@ -40,15 +43,16 @@ argparser.add_option('-p', '--persist', dest='persist', action='store_true',
try:
noderange = args[0]
except IndexError:
sys.stderr.write(
'Usage: {0} <noderange> [default|cd|network|setup|hd]\n'.format(
sys.argv[0]))
argparser.print_usage()
sys.exit(1)
bootdev = None
if len(sys.argv) > 2:
bootdev = sys.argv[2]
if len(args) > 1:
bootdev = args[1]
if bootdev in ('net', 'pxe'):
bootdev = 'network'
if bootdev not in valid_targets:
argparser.print_usage()
sys.exit(1)
session = client.Command()
exitcode = 0
if options.biosmode:
-1
View File
@@ -290,7 +290,6 @@ def _authorize_request(env, operation):
cookie['confluentsessionid'] = sessid
cookie['confluentsessionid']['secure'] = 1
cookie['confluentsessionid']['httponly'] = 1
cookie['confluentsessionid']['path'] = '/'
skiplog = _should_skip_authlog(env)
if authdata:
auditmsg = {
+4 -4
View File
@@ -1,8 +1,8 @@
cd `dirname $0`
VERSION=`git tag -l|tail -n 1`
NUMCOMMITS=`git rev-list $VERSION..HEAD|wc -l`
if [ "$NUMCOMMITS" -ne 0 ]; then
VERSION=$VERSION.dev$NUMCOMMITS.g`git rev-parse --short HEAD`
VERSION=`git describe|cut -d- -f 1`
NUMCOMMITS=`git describe|cut -d- -f 2`
if [ "$NUMCOMMITS" != "$VERSION" ]; then
VERSION=$VERSION.dev$NUMCOMMITS.g`git describe|cut -d- -f 3`
fi
echo $VERSION > VERSION
sed -e "s/#VERSION#/$VERSION/" setup.py.tmpl > setup.py