Skip to content

Commit 0387f39

Browse files
TaykYokufstagni
andcommitted
fix: change annotation from S_OK to dict, minor fixes
minor fixes fix: Update src/DIRAC/FrameworkSystem/scripts/dirac_login.py fix: Update src/DIRAC/FrameworkSystem/scripts/dirac_login.py fix: Update src/DIRAC/FrameworkSystem/scripts/dirac_login.py Co-Authored-By: fstagni <[email protected]>
1 parent 87a5beb commit 0387f39

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/DIRAC/FrameworkSystem/scripts/dirac_login.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
)
3939

4040

41-
class Params(object):
41+
class Params:
4242
"""This class describes the input parameters"""
4343

4444
def __init__(self):
@@ -54,15 +54,15 @@ def __init__(self):
5454
self.authWith = "certificate"
5555
self.enableCS = True
5656

57-
def disableCS(self, _arg) -> S_OK:
57+
def disableCS(self, _arg) -> dict:
5858
"""Set issuer
5959
6060
:param arg: issuer
6161
"""
6262
self.enableCS = False
6363
return S_OK()
6464

65-
def setIssuer(self, arg: str) -> S_OK:
65+
def setIssuer(self, arg: str) -> dict:
6666
"""Set issuer
6767
6868
:param arg: issuer
@@ -71,15 +71,15 @@ def setIssuer(self, arg: str) -> S_OK:
7171
self.issuer = arg
7272
return S_OK()
7373

74-
def useDIRACAS(self, _arg) -> S_OK:
74+
def useDIRACAS(self, _arg) -> dict:
7575
"""Use DIRAC AS
7676
7777
:param _arg: unuse
7878
"""
7979
self.authWith = "diracas"
8080
return S_OK()
8181

82-
def useCertificate(self, _arg) -> S_OK:
82+
def useCertificate(self, _arg) -> dict:
8383
"""Use certificate
8484
8585
:param _arg: unuse
@@ -89,19 +89,19 @@ def useCertificate(self, _arg) -> S_OK:
8989
self.result = "proxy"
9090
return S_OK()
9191

92-
def setCertificate(self, arg: str) -> S_OK:
92+
def setCertificate(self, arg: str) -> dict:
9393
"""Set certificate file path
9494
9595
:param arg: path
9696
"""
9797
if not os.path.exists(arg):
98-
DIRAC.gLogger.error(f"{arg} is not exist.")
98+
DIRAC.gLogger.error(f"{arg} does not exist.")
9999
DIRAC.exit(1)
100100
self.useCertificate(None)
101101
self.certLoc = arg
102102
return S_OK()
103103

104-
def setPrivateKey(self, arg: str) -> S_OK:
104+
def setPrivateKey(self, arg: str) -> dict:
105105
"""Set private key file path
106106
107107
:param arg: path
@@ -113,23 +113,23 @@ def setPrivateKey(self, arg: str) -> S_OK:
113113
self.keyLoc = arg
114114
return S_OK()
115115

116-
def setOutputFile(self, arg: str) -> S_OK:
116+
def setOutputFile(self, arg: str) -> dict:
117117
"""Set output file location
118118
119119
:param arg: output file location
120120
"""
121121
self.outputFile = arg
122122
return S_OK()
123123

124-
def setLivetime(self, arg: str) -> S_OK:
125-
"""Set proxy livetime
124+
def setLifetime(self, arg: str) -> dict:
125+
"""Set proxy lifetime
126126
127127
:param arg: lifetime
128128
"""
129129
self.lifetime = arg
130130
return S_OK()
131131

132-
def setProxy(self, _arg) -> S_OK:
132+
def setProxy(self, _arg) -> dict:
133133
"""Return proxy
134134
135135
:param _arg: unuse
@@ -138,7 +138,7 @@ def setProxy(self, _arg) -> S_OK:
138138
self.result = "proxy"
139139
return S_OK()
140140

141-
def setToken(self, _arg) -> S_OK:
141+
def setToken(self, _arg) -> dict:
142142
"""Return tokens
143143
144144
:param _arg: unuse
@@ -148,7 +148,7 @@ def setToken(self, _arg) -> S_OK:
148148
self.result = "token"
149149
return S_OK()
150150

151-
def authStatus(self, _arg) -> S_OK:
151+
def authStatus(self, _arg) -> dict:
152152
"""Get authorization status
153153
154154
:param _arg: unuse
@@ -166,7 +166,7 @@ def registerCLISwitches(self):
166166
"group: select a DIRAC group for authorization, can be determined later.", mandatory=False
167167
)
168168
Script.registerArgument(["scope: scope to add to authorization request."], mandatory=False)
169-
Script.registerSwitch("T:", "lifetime=", "set access lifetime in a hours", self.setLivetime)
169+
Script.registerSwitch("T:", "lifetime=", "set access lifetime in hours", self.setLifetime)
170170
Script.registerSwitch(
171171
"O:",
172172
"save-output=",

src/DIRAC/FrameworkSystem/scripts/dirac_logout.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,20 @@
2121
)
2222

2323

24-
class Params(object):
24+
class Params:
2525
def __init__(self):
2626
self.issuer = None
2727
self.targetFile = None
2828

29-
def setIssuer(self, arg: str) -> S_OK:
29+
def setIssuer(self, arg: str) -> dict:
3030
"""Set issuer
3131
3232
:param arg: issuer
3333
"""
3434
self.issuer = arg
3535
return S_OK()
3636

37-
def setFile(self, arg: str) -> S_OK:
37+
def setFile(self, arg: str) -> dict:
3838
"""Set token/proxy file
3939
4040
:param arg: token file

0 commit comments

Comments
 (0)