Ganga :: GPIDev :: Credentials :: GridProxy :: GridProxy :: Class GridProxy
[hide private]
[frames] | no frames]

Class GridProxy

source code

          object --+            
                   |            
   Base.Objects.Node --+        
                       |        
Base.Objects.GangaObject --+    
                           |    
     ICredential.ICredential --+
                               |
                              GridProxy

Class for working with Grid proxy

Nested Classes [hide private]

Inherited from Base.Objects.GangaObject: __metaclass__

Instance Methods [hide private]
 
__init__(self, middleware="EDG")
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
chooseCommandSet(self)
Choose command set to be used for proxy-related commands
source code
 
buildOpts(self, command, clear=True) source code
 
create(self, validity="", maxTry=0, minValidity="", check=False)
Create credential.
source code
 
destroy(self, allowed_exit=[0,1])
Destroy credential
source code
 
isAvailable(self)
Check whether credential is available with system/configuration used
source code
 
isValid(self, validity="", log=False, force_check=False)
Check validity
source code
 
location(self)
Determine credential location
source code
 
fullIdentity(self, safe=False)
Return the users full identity as a dictionary
source code
 
identity(self, safe=False)
Return user's identify
source code
 
info(self, opt="", force_check=False)
Obtain proxy information
source code
 
renew(self, validity="", maxTry=0, minValidity="", check=True)
Renew credential.
source code
 
timeleft(self, units="hh:mm:ss", force_check=False)
Check time for which credential is valid.
source code
 
timeleftInHMS(self, force_check=False)
Determine remaining validity of credential in hours, minutes and seconds
source code
 
voname(self, force_check=False)
Obtain name of virtual organisation from proxy
source code
 
getProxyCacheValue(self, opt)
Check the proxy cache for the required key.
source code
 
addToProxyCache(self, status, output, opt)
Test the result of grid proxy call and add to the cache if all OK
source code

Inherited from ICredential.ICredential: timeInSeconds

Inherited from Base.Objects.GangaObject: __construct__, __deepcopy__, __getstate__, __setstate__, _attribute_filter__set__, _auto__init__, accept, getJobObject

Inherited from Base.Objects.Node: __copy__, __eq__, __ne__, clone, copyFrom, printSummaryTree, printTree

Inherited from Base.Objects.Node (private): _getParent, _getRoot, _setParent

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from Base.Objects.GangaObject (private): _declared_property

Class Variables [hide private]
  _schema = ICredential._schema.inherit_copy()
  _name = "GridProxy"
  _hidden = 1
  _enable_config = 1
  _exportmethods = ["create", "destroy", "identity", "info", "is...

Inherited from ICredential.ICredential (private): _category

Inherited from Base.Objects.GangaObject (private): _proxyClass, _registry

Inherited from Base.Objects.Node (private): _index_cache, _parent

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, middleware="EDG")
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

chooseCommandSet(self)

source code 

Choose command set to be used for proxy-related commands

No arguments other than self

If self.voms has a null value then the GridCommand set of commands is used. Otherwise the VomsCommand set of commands is used.

Return value: None

create(self, validity="", maxTry=0, minValidity="", check=False)

source code 

Create credential.

Arguments other than self:
   validity    - Validity with which credential should be created,
                 specified as string of format "hh:mm"
                 [ Defaults to value of self.validityAtCreation ]
   maxTry      - Number of password attempts allowed
                 [ Defaults to value of self.maxTry ]
   minValidity - Minimum validity in case checking of
                 pre-existing credential is performed,
                 specified as strong of format "hh:mm"
                 [ Defaults to value of self.minValidity ]
   check       - Flag to request checking of pre-existing
                 credential; if flag is set to true, then new
                 credential is created only if the validity of
                 any pre-existing credential is less than the
                 value of minValidity
                 [ Default: False ] 

Note: create is the same as renew, except for the default value of check

Return value: True if credential is created successfully, and False
otherwise.

Overrides: ICredential.ICredential.create
(inherited documentation)

destroy(self, allowed_exit=[0,1])

source code 

Destroy credential

Argument other than self:
   allowed_exit - List of exit codes accepted without error
                  when issuing system command for destroying credential

Return value: False if command for destroying credential is undefined,
              or True otherwise

Overrides: ICredential.ICredential.destroy
(inherited documentation)

isAvailable(self)

source code 

Check whether credential is available with system/configuration used

No arguments other than self

Return value: True if credential is available, false otherwise

Overrides: ICredential.ICredential.isAvailable
(inherited documentation)

isValid(self, validity="", log=False, force_check=False)

source code 

Check validity

Arguments other than self:
   validity    - Minimum time for which credential should be valid,
                 specified as string of format "hh:mm"
                 [ Defaults to valud of self.minValidity ]

   log         - Print logger messages if credential not valid 

   force_check - Force credential check, rather than relying on cache

Return value: True if credential is valid for required time, False
otherwise.

Overrides: ICredential.ICredential.isValid
(inherited documentation)

location(self)

source code 

Determine credential location

No arguments other than self

Return value: Path to credential if found, or empty string otherwise

Overrides: ICredential.ICredential.location
(inherited documentation)

fullIdentity(self, safe=False)

source code 

Return the users full identity as a dictionary

Argument:
   safe - logical flag
          =>  False : return identity exactly as obtained from proxy
          =>  True  : return identity after stripping out
                      non-alphanumeric characters

Return value: Dictionary of the various labels in the users DN

identity(self, safe=False)

source code 

Return user's identify

Argument:
   safe - logical flag
          =>  False : return identity exactly as obtained from proxy
          =>  True  : return identity after stripping out
                      non-alphanumeric characters

=> The identity is determined from the user proxy if possible,
   or otherwise from the user's top-level directory

Return value: String specifying user identity

info(self, opt="", force_check=False)

source code 

Obtain proxy information

Arguments other than self:
   opt         - String of options to be used when querying
                 proxy information
               => Help on valid options can be obtained using:
                  info( opt = "-help" )
   force_check - Force credential check, rather than relying on cache

Return value: Output from result of querying proxy

renew(self, validity="", maxTry=0, minValidity="", check=True)

source code 

Renew credential.

Arguments other than self:
   validity    - Validity with which credential should be created,
                 specified as string of format "hh:mm"
                 [ Defaults to value of self.validityAtCreation ]
   maxTry      - Number of password attempts allowed
                 [ Defaults to value of self.maxTry ]
   minValidity - Minimum validity in case checking of
                 pre-existing credential is performed,
                 specified as strong of format "hh:mm"
                 [ Defaults to value of self.minValidity ]
   check       - Flag to request checking of pre-existing
                 credential; if flag is set to true, then new
                 credential is created only if the validity of
                 any pre-existing credential is less than the
                 value of minValidity
                 [ Default: True ] 

Note: renew is the same as create, except for the default value of check

Return value: True if new credential is created successfully, and False
otherwise.

Overrides: ICredential.ICredential.renew
(inherited documentation)

timeleft(self, units="hh:mm:ss", force_check=False)

source code 

Check time for which credential is valid.

Arguments other than self:
   units       - String specifying units in which time is returned

   force_check - Force credential check, rather than relying on cache

Allowed values for units are:
   "hours"              - time returned as in hours
   "minutes"            - time returned in minutes
   "seconds"            - time returned in seconds
   "hh:mm:ss" [default] - time returned as hours, minutes seconds


Return value: Credential validity as string giving time in requested
   units, or empty string if command for querying credential validity
   is unavailable

Overrides: ICredential.ICredential.timeleft
(inherited documentation)

timeleftInHMS(self, force_check=False)

source code 

Determine remaining validity of credential in hours, minutes and seconds

Argument other than self:
   force_check - Force credential check, rather than relying on cache

Return value: String giving credential validity, or empty string
   if command for querying credential validity is unavailable

Overrides: ICredential.ICredential.timeleftInHMS
(inherited documentation)

voname(self, force_check=False)

source code 

Obtain name of virtual organisation from proxy

Argument other than self:
   force_check - Force credential check, rather than relying on cache

Return value: Name of virtual organisation where this can be determined
(voms proxy), or empty string otherwise (globus proxy)

getProxyCacheValue(self, opt)

source code 

Check the proxy cache for the required key. Make sure the proxy file is older than the last check.

opt - the key to check for

addToProxyCache(self, status, output, opt)

source code 

Test the result of grid proxy call and add to the cache if all OK

status - the status output output - the output text opt - opt to add


Class Variable Details [hide private]

_exportmethods

Value:
["create", "destroy", "identity", "info", "isAvailable", "isValid", "l\
ocation", "renew", "timeleft", "voname", "fullIdentity"]