-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglitch.py
executable file
·57 lines (42 loc) · 1.43 KB
/
glitch.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
import fire
from modules import IdracConnector
class GlitchLauncher(object):
"""
Glitch's command line tool. It brings html and java access to
any server, also it supports fast login to iDRAC UI and presents asset's details.
HOST argument may be [ IPMI_ADDRESS ]
:param host: (required)
:param user: (optional)
:param password: (optional)
"""
@staticmethod
def java(host, **kwargs):
"""
This command opens a java-applet with VirtualConsole.
:param host: (required)
:param user: (optional)
:param password: (optional)
"""
IdracConnector(host=host, **kwargs).open_java_console()
@staticmethod
def html(host, **kwargs):
"""
This command opens a html5 viewer with VirtualConsole.
There are versions of Idrac that doesn't support a direct access to html5 viewer
:param host: (required)
:param user: (optional)
:param password: (optional)
"""
IdracConnector(host=host, **kwargs).open_html_console()
@staticmethod
def ui(host, **kwargs):
"""
This command opens a Idrac login page for fast access to the WebUI.
:param host: (required)
:param user: (optional)
:param password: (optional)
"""
IdracConnector(host=host, **kwargs).open_idrac_ui()
if __name__ == '__main__':
fire.Fire(GlitchLauncher)