mirror of
https://github.com/xcat2/confluent.git
synced 2026-12-01 23:02:22 +00:00
Merge remote-tracking branch 'xcat/master'
This commit is contained in:
@@ -54,6 +54,14 @@ Additionally, if wanting to change from a node level attribute value to inherit
|
||||
member group, it is required to use '-c' to clear the attribute. Conversely, assigning
|
||||
to a blank value will allow masking a group defined attribute with an empty value.
|
||||
|
||||
## ALIASES
|
||||
|
||||
The following short names expand to their full attribute names:
|
||||
|
||||
* `bmc` expands to `hardwaremanagement.manager`
|
||||
* `bmcuser` and `switchuser` expand to `secret.hardwaremanagementuser`
|
||||
* `bmcpass` and `switchpass` expand to `secret.hardwaremanagementpassword`
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* `-b`, `--blame`:
|
||||
|
||||
@@ -17,6 +17,9 @@ as stderr, unlike psh which combines all stdout and stderr into stdout.
|
||||
* `-c COUNT`, `-f COUNT`, `--count=COUNT`
|
||||
Specify the maximum number of instances to run concurrently
|
||||
|
||||
* `-e ENVVAR`, `--environmentpassword=ENVVAR`
|
||||
Environment variable containing the password to use for ssh
|
||||
|
||||
* `-l LOGINNAME`, `--loginname=LOGINNAME`
|
||||
Username to use when connecting, defaults to current user.
|
||||
|
||||
@@ -40,6 +43,9 @@ as stderr, unlike psh which combines all stdout and stderr into stdout.
|
||||
* `-t TIMEOUT`, `--timeout=TIMEOUT`
|
||||
Timeout in seconds for each node ssh connection attempt
|
||||
|
||||
* `-x`, `--noexpression`
|
||||
Suppress confluent attribute expression expansion of the command
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
* Running `echo hi` on for nodes:
|
||||
|
||||
@@ -776,9 +776,11 @@ async def _recheck_nodes_backend(nodeattribs, configmanager):
|
||||
continue
|
||||
# now we go through ones that were identified, but could not pass
|
||||
# policy or hadn't been able to verify key
|
||||
for nodename in pending_nodes:
|
||||
for nodename in list(pending_nodes):
|
||||
await asyncio.sleep(0)
|
||||
info = pending_nodes[nodename]
|
||||
info = pending_nodes.get(nodename, None)
|
||||
if info is None:
|
||||
continue
|
||||
try:
|
||||
if info['handler'] is None:
|
||||
continue
|
||||
|
||||
@@ -122,7 +122,7 @@ class GlobalConfigError(ConfluentException):
|
||||
class TargetResourceUnavailable(ConfluentException):
|
||||
# This is meant for scenarios like asking to read a sensor that is
|
||||
# currently unavailable. This may be a persistent or transient state
|
||||
apierrocode = 503
|
||||
apierrorcode = 503
|
||||
_apierrorstr = 'Target Resource Unavailable'
|
||||
|
||||
class PubkeyInvalid(ConfluentException):
|
||||
|
||||
@@ -296,7 +296,7 @@ class ConfluentResourceUnavailable(ConfluentNodeError):
|
||||
defaulterror = 'Unavailable'
|
||||
|
||||
def strip_node(self, node):
|
||||
raise exc.TargetResourceUnavailable()
|
||||
raise exc.TargetResourceUnavailable(self.error)
|
||||
|
||||
|
||||
class ConfluentTargetTimeout(ConfluentNodeError):
|
||||
|
||||
@@ -107,6 +107,16 @@ class GeistClient(object):
|
||||
)
|
||||
self._token = None
|
||||
|
||||
async def get_outlet_ids(self):
|
||||
rsp = await self.wc.grab_json_response('/api/dev')
|
||||
dbt = data_by_type(rsp['data'])
|
||||
if 't3hd' in dbt:
|
||||
del dbt['t3hd']
|
||||
if len(dbt) != 1:
|
||||
raise Exception('Multiple PDUs not supported per pdu')
|
||||
pdutype = list(dbt)[0]
|
||||
return sorted(int(idx) + 1 for idx in dbt[pdutype].get('outlet', {}))
|
||||
|
||||
async def get_outlet(self, outlet):
|
||||
rsp = await self.wc.grab_json_response('/api/dev')
|
||||
rsp = rsp['data']
|
||||
@@ -238,6 +248,12 @@ async def read_sensors(element, node, configmanager):
|
||||
return msg.SensorReadings(readings, name=node)
|
||||
|
||||
|
||||
async def list_outlets(node, configmanager):
|
||||
gc = GeistClient(node, configmanager)
|
||||
for idx in await gc.get_outlet_ids():
|
||||
yield msg.ChildCollection(str(idx))
|
||||
|
||||
|
||||
async def get_outlet(element, node, configmanager):
|
||||
gc = GeistClient(node, configmanager)
|
||||
state = await gc.get_outlet(element[-1])
|
||||
@@ -302,6 +318,11 @@ async def read_inventory(element, node, configmanager):
|
||||
async def retrieve(nodes, element, configmanager, inputdata):
|
||||
|
||||
if 'outlets' in element:
|
||||
if element[-1] == 'outlets':
|
||||
for node in nodes:
|
||||
async for res in list_outlets(node, configmanager):
|
||||
yield res
|
||||
return
|
||||
gp = tasks.TaskPile(pdupool)
|
||||
for node in nodes:
|
||||
gp.spawn(get_outlet, element, node, configmanager)
|
||||
|
||||
@@ -142,6 +142,8 @@ async def send_grant(conn, nodename, rqtype):
|
||||
'secret.hardwaremanagementpassword', {}).get('value', None)
|
||||
host = c.get(nodename, {}).get(
|
||||
'hardwaremanagement.manager', {}).get('value', None)
|
||||
if host:
|
||||
host = host.split('/', 1)[0]
|
||||
if bmcuser and bmcpass and host:
|
||||
kv = util.TLSCertVerifier(cfg, nodename,
|
||||
'pubkeys.tls_hardwaremanager').verify_cert
|
||||
|
||||
Reference in New Issue
Block a user