-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpush_regex.py
More file actions
28 lines (27 loc) · 762 Bytes
/
push_regex.py
File metadata and controls
28 lines (27 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
This module provides ssh session for users.
"""
from processdb import process_nodes
from search import node_element
from search import search_node
def push_regex(args):
argument_node = args.regex
"""
:param argument_node: Argument accepted as regular expression.
:type augument_node: str
"""
node_object = process_nodes()
match_node = search_node(argument_node,node_object)
"""
:param node_object: All node(s) in the database with all attributes.
:type node_object: list
:param match_node: Nodes that matches the arguements passed in by user.
:type match_node: list
"""
if len(match_node) == 0:
print('+ No matching nodes found in database.')
print('')
else:
print('[>] Affected Nodes:')
for node in match_node:
print(node)