2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00
Commit Graph

66 Commits

Author SHA1 Message Date
Jarrod Johnson
a24866c2df Fix exitcode for confetty noderange commands
The exitcode was not being set for noderange commands
where each node may independently raise errors.

Correct the oversight by catching each subelements errors.
2020-01-31 08:22:20 -05:00
Jarrod Johnson
c1953bdad3 Another set of python 3 compatibility
Numerous issues arose, particularly
when participating in a mixed
collective.
2019-10-08 10:45:43 -04:00
Jarrod Johnson
74f18d5571 Client side py3 changes 2019-10-04 10:37:48 -04:00
Jarrod Johnson
44d6bde3ff Make /usr/bin/env python point to python2
Same as before, more RHEL8 compatibility changes
2019-09-23 11:04:52 -04:00
Jarrod Johnson
fbc4fc6846 Make unexpected error more specific
Often a usable summary message is obfuscated.  Assume the subject line
is safe to relay, but continue to do a more verbose trace.
2019-07-08 14:28:56 -04:00
Jarrod Johnson
bc995520b7 Fix confetty tab completion
The refactoring to main caused scope of readline to be incorrect.
Pulled the scope back into namespace.
2019-01-14 09:15:59 -05:00
Jarrod Johnson
075891bf74 Add option to confetty to help keep terminal open on early exit
For contexts where early execution execution almost always means
some sort of error, but the terminal automatically closes,
provide a minimum time to execute option so confetty will
forcibly slow things down in such a likely scenario.
2018-12-03 14:49:19 -05:00
Jarrod Johnson
b511a02f20 Have correct size on connect for shell session
In addition to resize, also support initial size being set
2018-11-26 16:21:31 -05:00
Jarrod Johnson
c60cb3a027 Implement resize from CLI client
The CLI resize is wired up for ssh usage.  At the time of this commit,
initial size is not handled.
2018-11-26 15:31:36 -05:00
Jarrod Johnson
9f137fa6d4 Begin work to send resize to remote
While we do not have a path forward for auto-resize in SOL consoles,
we can provide the capability for ssh consoles.  The CLI being enabled
is of course nice, but running ssh directly is still suggested in such
a context and ultimately the Web GUI will be the most prominent
consumer of the information.
2018-11-20 16:01:36 -05:00
Jarrod Johnson
73cab3774d Add support for volume creation 2018-10-26 14:31:28 -04:00
Jarrod Johnson
36fc23d692 Avoid VT control codes on exit through pipe
Piped commands were subjected to terminal control sequences that
could interfere with desired operation.
2018-09-20 11:05:00 -04:00
Jarrod Johnson
ecbe1a86b1 Revert "Have nodeconsole restore term on exit"
This reverts commit 2972374da8.
2018-08-02 10:27:37 -04:00
Jarrod Johnson
2972374da8 Have nodeconsole restore term on exit 2018-08-02 10:07:41 -04:00
Jarrod Johnson
5ca52ff03b Handle interruptions to select such as resize
Resize can cause an interrupted operation on stdin, handle that.
2018-04-09 10:48:06 -04:00
Jarrod Johnson
0b0f325240 Shorten power check interval
The interval can be shorter with little ill-effect.
2017-11-13 14:22:30 -05:00
Jarrod Johnson
29330aee74 Clear [powered off] from screen if state change detected
Previously, only transition to powered on was detected.  React
to situations where data comes up or power status change.
2017-11-13 14:04:09 -05:00
Jarrod Johnson
148329dd8e Implement send resize commands
Craft correct stty commands based on terminal size
detected by confluent.
2017-11-06 11:09:55 -05:00
Jarrod Johnson
d9ffa10422 Restore power query function
Implement it in a fashion that does not block confetty while long
running power query situations happen.
2017-11-06 10:24:32 -05:00
Jarrod Johnson
9c6b10a166 Sort output from confetty
Sorting can greatly improve the readability of some
confluent functionality.
2017-10-04 09:09:03 -04:00
Jarrod Johnson
563ee96879 Harden confetty to weird text strings
If it can't properly encode to printable, use repr instead.
2017-09-28 16:20:19 -04:00
Jarrod Johnson
9ff7829373 Fix typo in confetty
Strings do not have a startswitch method...
2017-08-16 15:06:48 -04:00
Jarrod Johnson
0393e55eb1 Implement API for reverse noderange
Provide reverse noderange through special
/noderange//abbreviate location.  This should enable
collate to abbreviate noderanges.
2017-08-14 14:41:43 -04:00
Jarrod Johnson
a3c06a00bf Fix confetty behavior when TERM not set
Particularly in non-interactive ssh, TERM is not set.
Assume empty string if TERM is not set.
2017-06-27 14:04:26 -04:00
Jarrod Johnson
e0cc67f57a Implement Lenovo Thinksystem and discovery support 2017-06-20 14:56:24 -04:00
Amanda Duffy
f4c191c280 Fix power off detection 2017-05-02 15:30:39 -04:00
Amanda Duffy
443b678d8a Add power off detection 2017-05-02 14:54:18 -04:00
Jarrod Johnson
43b51eec20 Be more friendly about shlex parsing errors
If user provides bad input, be more helpful and
less fatalistic.
2017-03-01 10:31:00 -05:00
Amanda Duffy
36bc81448e Fix missing ] and add entries to printed menu 2017-01-27 14:25:42 -05:00
Amanda Duffy
fdf74dbf11 Add power options for console commands 2017-01-27 13:44:12 -05:00
Jarrod Johnson
958be7d004 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 09:15:49 -04:00
Jarrod Johnson
16c7429900 Improve interactive performance of 'cd' to slow collections
Sometimes a collection will be slow.  Don't inflict the 'cd' with the slowness, defer until actually
asked to do something that would enumerate said collection.  Accomplish this by checking for
the 'cd' target in it's parent collection, rather than asking to list its contents.
2016-05-09 15:39:05 -04:00
Jarrod Johnson
7ff20e3e39 Close shell interface on remote disconnect 2016-03-13 18:48:58 -04:00
Jarrod Johnson
4442ce1c71 No longer break when prompting for name/password
In the confetty CLI, readline clear history was done as
part of login process.  Since readline is not a given
to accomodate scripting behaviors, no longer do the
clear_history().  The concern I had was that
the password might have gotten into history, but that
seems to not be the case.
2015-11-10 12:56:04 -05:00
Jarrod Johnson
b48cd8b685 Implement basic functionality under windows
Windows support by removing pid file, daemonizing, locking,
and other features.  Goal is to have a freezeable payload.
2015-09-23 11:48:17 -04:00
chenglch
fde68e1320 Fix 'start console session' command error
Command "confetty start /nodes/<node>/console/session" can
not work correctly. This patch aims to add condition judgement
for this command in confetty.
2015-09-08 22:58:44 -04:00
Jarrod Johnson
186929d217 Only conditionally import readline
If stdout is not a tty, do not import readline.  import
readline by itself can cause terminal control characters
to appear in the stdout.  Avoid this by only importing if
there seems to be a sign it is connected to a terminal.
2015-06-26 15:26:44 -04:00
Jarrod Johnson
6204628f43 Add support for inventory
Present 'inventory/hardware/all/' hierarchy.  Currently
only ipmi and 'all/all' works.  The data structure may be amended in
the very near future as well.
2015-04-27 16:57:52 -04:00
Jarrod Johnson
46b7550a41 Fix confetty live reconnect behavior
If on a remote socket, socket.error could be thrown.  A mistake was
made where the Python2.x behavior of ',' on an except clause without
parenthesis misinterpreted socket.error as a variable name to store
instance of socket.gaierror.  Put Parentheses in to declare the desired
behavior.
2015-03-26 14:03:56 -04:00
Jarrod Johnson
77284af60d Rework multiple node result data
Before there was some awkward ambiguity between top level
key names and node names.  For example a node named 'error'
would be tricky.  Address that by allocating a 'databynode'
top level container to clarify the namespace of keys is
nodenames specifically.  Use this to simplify code that
tried to workaround the ambiguity.
2015-03-23 09:38:56 -04:00
Jarrod Johnson
30d34c2527 Fix Unicode error on confetty pipe out
When unicode was encountered, it would through an *encode* error.
Fix that issue.
2015-03-20 17:08:53 -04:00
Jarrod Johnson
41698b2bad Include omitted changes from last commit
I did not include all intended changes in last
commit.
2015-03-19 15:06:31 -04:00
Jarrod Johnson
735cc268d1 Have confetty better handle noderange output
Have confetty print_result make a reasonable assumption to
have noderange based output show relevant node and output.
2015-03-16 10:15:27 -04:00
Victor Hu
1f7a0e77d6 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.
2015-02-10 17:18:16 -05:00
Jarrod Johnson
d06f5cc966 Provide seamless behavior for non-console activity
When submitting an interactive command and encountering error,
have confetty attempt to self heal and resubmit command.
2015-02-03 13:28:21 -05:00
Jarrod Johnson
ae1e3f2b8d Fix tab completion in middle of command
When doing tab completion, ignore content after the current index.
This was confusing the tab completion routine.  Also silently
ignore traces by default
2015-02-03 11:01:05 -05:00
Jarrod Johnson
0cd4ffcd3b Implement client reconnect on server restart
When the server restarts, clients should try to reconnect seamlessly.
Doing so allows maintenance without being overly disruptive to users.
2015-02-03 10:15:08 -05:00
Jarrod Johnon
c60d25f0d1 Fix confetty PTY handling in oneshot mode
When asked to execute a command, do not mess with the terminal
in a way that would incur SIGTTOU when run in background.  This
means that a backgrounded confetty can actually exit rather
than block waiting to be run in foreground.  This won't work
with running a *console* in background, but that really doesn't
make any sense.
2015-01-22 11:52:50 -05:00
Jarrod Johnon
14ce9970ad Fix unicode error on stdout piping
When confetty runs in a UTF-8 terminal, things are fine.  However python
assumes ascii only when piped.  Catch the situation and force utf-8
encoding rather than erroring out in such a circumstance
2015-01-20 16:11:16 -05:00
Jarrod Johnon
384baea038 Handle non-ascii unicode better
Clarify that the data is in UTF-8 where applicable.  It is expected
that clients are capable of handling UTF-8 for now.  Additionally,
the HTML api explorer handling of numeric data is fixed.
2015-01-19 14:45:24 -05:00