11
11
import time
12
12
13
13
from DIRAC import gConfig , gLogger
14
- from DIRAC .ConfigurationSystem .Client .Helpers import CSGlobals
15
14
from DIRAC .Core .Base .CLI import CLI , colorize
16
15
from DIRAC .Core .Security .ProxyInfo import getProxyInfo
17
16
from DIRAC .Core .Utilities import List
@@ -623,6 +622,11 @@ def do_install(self, args):
623
622
install agent <system> <agent> [-m <ModuleName>] [-p <Option>=<Value>] [-p <Option>=<Value>] ...
624
623
install executor <system> <executor> [-m <ModuleName>] [-p <Option>=<Value>] [-p <Option>=<Value>] ...
625
624
"""
625
+ result = getProxyInfo ()
626
+ if not result ["OK" ]:
627
+ self ._errMsg (result ["Message" ])
628
+ user = result ["Value" ]["username" ]
629
+
626
630
argss = args .split ()
627
631
hostSetup = extension = None
628
632
if not argss :
@@ -673,7 +677,7 @@ def do_install(self, args):
673
677
674
678
if database != "InstalledComponentsDB" :
675
679
result = MonitoringUtilities .monitorInstallation (
676
- "DB" , system .replace ("System" , "" ), database , cpu = cpu , hostname = hostname
680
+ "DB" , system .replace ("System" , "" ), database , cpu = cpu , hostname = hostname , user = user
677
681
)
678
682
if not result ["OK" ]:
679
683
self ._errMsg (result ["Message" ])
@@ -786,14 +790,14 @@ def do_install(self, args):
786
790
return
787
791
788
792
result = MonitoringUtilities .monitorInstallation (
789
- "DB" , system , "InstalledComponentsDB" , cpu = cpu , hostname = hostname
793
+ "DB" , system , "InstalledComponentsDB" , cpu = cpu , hostname = hostname , user = user
790
794
)
791
795
if not result ["OK" ]:
792
796
self ._errMsg (f"Error registering installation into database: { result ['Message' ]} " )
793
797
return
794
798
795
799
result = MonitoringUtilities .monitorInstallation (
796
- option , system , component , module , cpu = cpu , hostname = hostname
800
+ option , system , component , module , cpu = cpu , hostname = hostname , user = user
797
801
)
798
802
if not result ["OK" ]:
799
803
self ._errMsg (f"Error registering installation into database: { result ['Message' ]} " )
@@ -820,6 +824,7 @@ def do_uninstall(self, args):
820
824
result = getProxyInfo ()
821
825
if not result ["OK" ]:
822
826
self ._errMsg (result ["Message" ])
827
+ user = result ["Value" ]["username" ]
823
828
824
829
option = argss [0 ]
825
830
if option == "db" :
@@ -842,7 +847,7 @@ def do_uninstall(self, args):
842
847
self ._errMsg (result ["Message" ])
843
848
return
844
849
system = result ["Value" ][component ]["System" ]
845
- result = MonitoringUtilities .monitorUninstallation (system , component , hostname = hostname , cpu = cpu )
850
+ result = MonitoringUtilities .monitorUninstallation (system , component , hostname = hostname , cpu = cpu , user = user )
846
851
if not result ["OK" ]:
847
852
self ._errMsg (result ["Message" ])
848
853
return
@@ -937,7 +942,7 @@ def do_uninstall(self, args):
937
942
else :
938
943
cpu = result ["Value" ]["CPUModel" ]
939
944
hostname = self .host
940
- result = MonitoringUtilities .monitorUninstallation (system , component , hostname = hostname , cpu = cpu )
945
+ result = MonitoringUtilities .monitorUninstallation (system , component , hostname = hostname , cpu = cpu , user = user )
941
946
if not result ["OK" ]:
942
947
return result
943
948
0 commit comments