SAFplus Runtime Director API  3.0.5
psh Namespace Reference

Classes

class  ExceptionPsh
 Raised for pxssh exceptions. More...
 
class  ExceptionErrorCode
 Raised when an program returns an error code. More...
 
class  Psh
 This class encapsulates a lot of functionality available from the shell. More...
 

Functions

def apply_redict
 This helper function searches a dictionary of regular expressions that select a single result (i.e. More...
 

Variables

dictionary ifconfigDict
 

Function Documentation

def psh.apply_redict (   str,
  dict 
)

This helper function searches a dictionary of regular expressions that select a single result (i.e.

the re has a single ()) to a string and creates a new dictionary similar to the input except that all regular expression have be replaced with their match result or None if there were no matches

Variable Documentation

dictionary psh.ifconfigDict
Initial value:
1 = {
2  "mac": re.compile("HWaddr\s+(\S+)"),
3  "ip": re.compile("inet\saddr:(\S+)"),
4  "bcast": re.compile("Bcase:(\S+)"),
5  "mask": re.compile("Mask:(\S+)"),
6  "phy": re.compile("Link\sencap:(\S+)"),
7  "mtu": re.compile("MTU:(\S+)"),
8  "metric": re.compile("Metric:(\S+)"),
9  "state": re.compile("(UP|DOWN)"),
10  "bcast": re.compile("(BROADCAST)"),
11  "mcast": re.compile("(MULTICAST)"),
12  "running": re.compile("(RUNNING)")
13  }