easy-utils-dev 2.126__py3-none-any.whl → 2.127__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of easy-utils-dev might be problematic. Click here for more details.
- easy_utils_dev/ne1830PSS.py +15 -30
- {easy_utils_dev-2.126.dist-info → easy_utils_dev-2.127.dist-info}/METADATA +1 -1
- {easy_utils_dev-2.126.dist-info → easy_utils_dev-2.127.dist-info}/RECORD +6 -6
- {easy_utils_dev-2.126.dist-info → easy_utils_dev-2.127.dist-info}/WHEEL +0 -0
- {easy_utils_dev-2.126.dist-info → easy_utils_dev-2.127.dist-info}/license.dat +0 -0
- {easy_utils_dev-2.126.dist-info → easy_utils_dev-2.127.dist-info}/top_level.txt +0 -0
easy_utils_dev/ne1830PSS.py
CHANGED
|
@@ -13,7 +13,7 @@ from easy_utils_dev import exceptions
|
|
|
13
13
|
|
|
14
14
|
class PSS1830 :
|
|
15
15
|
def __init__(self , sim=False , debug_name='Auto1830PSS' , auto_enable_tcp_forward=False,file_name=None,debug_home_path=None ) -> None:
|
|
16
|
-
self.port =
|
|
16
|
+
self.port = None
|
|
17
17
|
self.logger = DEBUGGER(debug_name,file_name=file_name, homePath=debug_home_path)
|
|
18
18
|
self.connected = False
|
|
19
19
|
self.channel = None
|
|
@@ -45,8 +45,8 @@ class PSS1830 :
|
|
|
45
45
|
self.tcpForwardStatus=None
|
|
46
46
|
self.resetRequired = False
|
|
47
47
|
self.screenBuffer = ""
|
|
48
|
-
self.main_controller_client = None
|
|
49
|
-
self.standby_controller_client = None
|
|
48
|
+
self.main_controller_client : paramiko.SSHClient = None
|
|
49
|
+
self.standby_controller_client : paramiko.SSHClient = None
|
|
50
50
|
self.create_jumphost = self.nfmtJumpServer
|
|
51
51
|
if self.auto_enable_tcp_forward :
|
|
52
52
|
self.logger.info(f'***WARNING*** : Auto enable tcp forwarding is enabled. This will allow tcp fowarding in target machine then restarting sshd service agent.')
|
|
@@ -62,14 +62,14 @@ class PSS1830 :
|
|
|
62
62
|
if level == 'debug' :
|
|
63
63
|
self._change_paramiko_debug
|
|
64
64
|
|
|
65
|
-
def nfmtJumpServer(self, ip , usr , pw ) :
|
|
65
|
+
def nfmtJumpServer(self, ip , usr , pw , port=22 ) :
|
|
66
66
|
self.logger.info(f"""ssh to jump-host -> address={ip}""")
|
|
67
67
|
# print(f"this function will be deperecated soon. use create_jumphost() instead.")
|
|
68
68
|
try :
|
|
69
69
|
self.jumpServerInSameInstance = True
|
|
70
70
|
self.jumpserver = self.createClient()
|
|
71
71
|
self.logger.info(f'connecting to jump-host with {usr}@{ip} port=[{self.port}] ..')
|
|
72
|
-
self.jumpserver.connect(ip ,
|
|
72
|
+
self.jumpserver.connect(ip , port , usr , pw )
|
|
73
73
|
self.isjumpserver = True
|
|
74
74
|
self.nfmtip = ip
|
|
75
75
|
self.nfmtsshuser = usr
|
|
@@ -83,7 +83,7 @@ class PSS1830 :
|
|
|
83
83
|
self.jumpserver.close()
|
|
84
84
|
self.logger.debug(f"""re-establish the connection after modifying the sshd file and restarting the sshd service ..""")
|
|
85
85
|
self.jumpserver = self.createClient()
|
|
86
|
-
self.jumpserver.connect(ip ,
|
|
86
|
+
self.jumpserver.connect(ip , port , usr , pw , banner_timeout=200 , timeout=200, auth_timeout=200)
|
|
87
87
|
self.logger.info(f"""connecting to jump-host [{ip}] - connected""")
|
|
88
88
|
self.connected = True
|
|
89
89
|
self.jumpserver.nfmtip = ip
|
|
@@ -467,10 +467,13 @@ class PSS1830 :
|
|
|
467
467
|
|
|
468
468
|
def switch_to_standby_ec(self) :
|
|
469
469
|
if self.connect_to_standby_ec :
|
|
470
|
-
self.logger.
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
470
|
+
self.logger.info(f"connecting to standby EC {self.neip} ...")
|
|
471
|
+
if not self.sim :
|
|
472
|
+
response = self.ssh_execute(ssh=self.client , command=f"ifconfig ilan | awk '/inet / {{print $2}}'")
|
|
473
|
+
if not response :
|
|
474
|
+
raise exceptions.InvalidRemoteEcIp(f"couldn't connect to remote EC")
|
|
475
|
+
if self.sim :
|
|
476
|
+
response = "100.0.81.1"
|
|
474
477
|
if response :
|
|
475
478
|
current_ec_ip = response.replace('\n' , '')
|
|
476
479
|
switcher = {
|
|
@@ -653,22 +656,6 @@ class PSS1830 :
|
|
|
653
656
|
def switch_to_cli_shell(self) :
|
|
654
657
|
return self.client.invoke_shell()
|
|
655
658
|
|
|
656
|
-
|
|
657
|
-
def isRequireAknowledge(self , newRelease) :
|
|
658
|
-
if '-' in str(newRelease) :
|
|
659
|
-
newRelease = float(newRelease.split('-')[0])
|
|
660
|
-
if int(newRelease) in range( 0 , 15 ) :
|
|
661
|
-
return True
|
|
662
|
-
elif int(newRelease) >= 23 :
|
|
663
|
-
return False
|
|
664
|
-
else :
|
|
665
|
-
return True
|
|
666
|
-
|
|
667
|
-
def getTime(self) :
|
|
668
|
-
now = datetime.now()
|
|
669
|
-
dt_string = now.strftime("%d-%m-%Y_%H-%M-%S")
|
|
670
|
-
return dt_string
|
|
671
|
-
|
|
672
659
|
def get_neversion(self,supress_error=False,cache=True) :
|
|
673
660
|
"""
|
|
674
661
|
retreive the NE version depending on connection mode
|
|
@@ -714,7 +701,6 @@ class PSS1830 :
|
|
|
714
701
|
self.close_cliconnection()
|
|
715
702
|
except :
|
|
716
703
|
pass
|
|
717
|
-
|
|
718
704
|
try :
|
|
719
705
|
self.client.close()
|
|
720
706
|
except :
|
|
@@ -735,13 +721,12 @@ class PSS1830 :
|
|
|
735
721
|
cli = f'paging status disable'
|
|
736
722
|
self.cli_execute(cli)
|
|
737
723
|
self.logger.debug('paging disabled.')
|
|
738
|
-
|
|
739
724
|
|
|
740
725
|
def channels_report(self, exportCsv=False) :
|
|
741
726
|
self.logger.info('Generating Channels Report .. ')
|
|
742
727
|
channels = self.get_xcs()
|
|
743
728
|
header = ['NE', 'shelf', 'slot', 'port' , 'powerRx' , "powerTx" , "channel" , "prefec" ,"postFec" , "shape" , "phase" , "trackMode"]
|
|
744
|
-
csvFpath = f"channels_report_{self.host}_{
|
|
729
|
+
csvFpath = f"channels_report_{self.host}_{getTimestamp()}.csv"
|
|
745
730
|
if exportCsv :
|
|
746
731
|
csvFile = open(csvFpath, 'w', encoding='UTF8' , newline='')
|
|
747
732
|
csvFile = csv.writer(csvFile)
|
|
@@ -834,7 +819,7 @@ class PSS1830 :
|
|
|
834
819
|
except :
|
|
835
820
|
return ''
|
|
836
821
|
|
|
837
|
-
def
|
|
822
|
+
def config_backup_db_server(self , ip , user, password , protocol , path , backupname="BACKUP") :
|
|
838
823
|
self.cli_execute(f'config database server ip {ip}')
|
|
839
824
|
self.cli_execute(f'config database server protocol {protocol}')
|
|
840
825
|
self.cli_execute(f'config database path {path}{backupname}')
|
|
@@ -16,7 +16,7 @@ easy_utils_dev/filescompressor.py,sha256=iKAtLfkEXOuvvqF56jH0D9KAAeZ7iaa_sRaJnyY
|
|
|
16
16
|
easy_utils_dev/generate_license.py,sha256=fr_eoSjKCmDmAEBc6FWFXZxGQOHx9XO6hEK8dcyVUlA,3319
|
|
17
17
|
easy_utils_dev/keycloakapi.py,sha256=eHnc5fSC-YVYQU6EFs3ehutITnkHNJktx5BH_hpfxwM,7116
|
|
18
18
|
easy_utils_dev/lralib.py,sha256=3IjaZbTK_hhyETNP7eALsFyQjWM-jb2rg-rjvgdDDIc,6328
|
|
19
|
-
easy_utils_dev/ne1830PSS.py,sha256=
|
|
19
|
+
easy_utils_dev/ne1830PSS.py,sha256=tfQGEllBWynwDdsy6Fa7nbazPkV4aNXE6HHkN122RBw,69781
|
|
20
20
|
easy_utils_dev/nsp_kafka.py,sha256=oPJUk8GYMLjqXP_H0EbXQwLkpBxf_uGr6l2QtZO1cc8,10725
|
|
21
21
|
easy_utils_dev/openid_server.py,sha256=_odeg6omuizSUEJLtbAVn2PnG9vkcUAQ7rU3K5yXk_I,2545
|
|
22
22
|
easy_utils_dev/optics_utils.py,sha256=G-hFX2iiUCSJjk7BICBRGvVoDq0IBONLZSjagoB5FMg,964
|
|
@@ -28,8 +28,8 @@ easy_utils_dev/utils.py,sha256=BmVnbxc336c6WTeDFcEHN6Mavt7fJrIEyK4GXODV3gI,13345
|
|
|
28
28
|
easy_utils_dev/winserviceapi.py,sha256=2ZP6jaSt1-5vEJYXqwBhwX-1-eQ3V3YzntsoOoko2cw,18804
|
|
29
29
|
easy_utils_dev/wsnoclib.py,sha256=tC-RmjddaLpihPCRBLGC2RnRpFJqexhvExUr1KncoQM,29063
|
|
30
30
|
easy_utils_dev/wsselib.py,sha256=YweScnoAAH_t29EeIjBpkQ6HtX0Rp9mQudRsRce2SE8,7920
|
|
31
|
-
easy_utils_dev-2.
|
|
32
|
-
easy_utils_dev-2.
|
|
33
|
-
easy_utils_dev-2.
|
|
34
|
-
easy_utils_dev-2.
|
|
35
|
-
easy_utils_dev-2.
|
|
31
|
+
easy_utils_dev-2.127.dist-info/METADATA,sha256=mj50JAg4vNXX0VT7PUfqCCRGazWLiP-PbKhBLgnP1R4,537
|
|
32
|
+
easy_utils_dev-2.127.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
33
|
+
easy_utils_dev-2.127.dist-info/license.dat,sha256=hTRbLnrYZdH7UOsZRYC3IntAhyUkUUXi4TuizI7gca4,74
|
|
34
|
+
easy_utils_dev-2.127.dist-info/top_level.txt,sha256=7vBsrpq7NmilkdU3YUvfd5iVDNBaT07u_-ut4F7zc7A,15
|
|
35
|
+
easy_utils_dev-2.127.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|