add call for nodename
This commit is contained in:
parent
bbf156057f
commit
76b6be03ab
18
calls.py
18
calls.py
|
@ -11,6 +11,24 @@ log = logging.getLogger(__name__)
|
|||
|
||||
|
||||
class EjabberdApiCalls(EjabberdApi):
|
||||
@property
|
||||
def nodename(self):
|
||||
if self._login is not None:
|
||||
node_str = re.compile('The node \'(.*)\'')
|
||||
status = self.cmd('status', {})
|
||||
|
||||
# matches
|
||||
try:
|
||||
tmp = node_str.findall(status)[0]
|
||||
# raise SystemExit code 17 if no status message is received
|
||||
except TypeError:
|
||||
raise SystemExit(17)
|
||||
|
||||
log.debug(f"fetched node string: {tmp}")
|
||||
return tmp
|
||||
|
||||
return None
|
||||
|
||||
@property
|
||||
def verstring(self):
|
||||
if self._login is not None:
|
||||
|
|
Loading…
Reference in New Issue