This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gobroker. commit 80bccbe510389416daefdb0867d408ab94e92841 Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> Date: Thu Mar 26 11:44:03 2015 +0100 agent.py: Completion of several __doc__ strings (missing @return:, @rtype: fields). --- x2gobroker/agent.py | 68 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 53 insertions(+), 15 deletions(-) diff --git a/x2gobroker/agent.py b/x2gobroker/agent.py index 462f188..566a8c0 100644 --- a/x2gobroker/agent.py +++ b/x2gobroker/agent.py @@ -157,7 +157,7 @@ def _call_remote_broker_agent(username, task, cmdline_args=[], remote_agent=None @type task: C{unicode} @param cmdline_args: additional command line parameters for the broker agent @type cmdline_args: C{list} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} @raise: L{X2GoBrokerAgentException} @@ -232,9 +232,12 @@ def ping(remote_agent=None, **kwargs): """\ Ping X2Go Broker Agent. - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: C{True} if broker agent responds + @rtype: C{bool} + """ username='foo' if remote_agent is None: @@ -252,9 +255,13 @@ def list_sessions(username, remote_agent=None, **kwargs): @param username: run the query on behalf of this username @type username: C{unicode} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: (<success>, <list-of-sessions>), a tuple with the <success> flag as first item + and a session C{list} as second item + @rtype: C{tuple} + """ return call_broker_agent(username, task='listsessions', remote_agent=remote_agent, **kwargs) tasks['listsessions'] = list_sessions @@ -266,9 +273,12 @@ def suspend_session(username, session_name, remote_agent=None, **kwargs): @param username: suspend the session on behalf of this username @type username: C{unicode} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: (<success>, ), a tuple with the <success> flag as first item + @rtype: C{tuple} + """ return call_broker_agent(username, task='suspendsession', cmdline_args=[session_name, ], remote_agent=remote_agent, **kwargs) tasks['suspendsession'] = suspend_session @@ -280,9 +290,12 @@ def terminate_session(username, session_name, remote_agent=None, **kwargs): @param username: terminate the session on behalf of this username @type username: C{unicode} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: (<success>, ), a tuple with the <success> flag as first item + @rtype: C{tuple} + """ return call_broker_agent(username, task='terminatesession', cmdline_args=[session_name, ], remote_agent=remote_agent, **kwargs) tasks['terminatesession'] = terminate_session @@ -295,10 +308,10 @@ def has_sessions(username, remote_agent=None, **kwargs): @param username: run the query on behalf of this username @type username: C{unicode} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} - @return: (<has-running-sessions>, <has-suspended-session>), a tuple of two Boolean values + @return: (<success>, <has-running-sessions>, <has-suspended-session>), a tuple of two Boolean values @rtype: C{tuple} """ @@ -307,7 +320,7 @@ def has_sessions(username, remote_agent=None, **kwargs): return (_success, [ s.split('|')[3] for s in _session_list if s.split('|')[4] == 'R' ], [ s.split('|')[3] for s in _session_list if s.split('|')[4] == 'S' ]) else: return (False, [], []) - +tasks['has-sessions'] = has_sessions def find_busy_servers(username, remote_agent=None, **kwargs): """\ @@ -319,9 +332,13 @@ def find_busy_servers(username, remote_agent=None, **kwargs): @param username: run the query on behalf of this username @type username: C{unicode} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: (<success>, <server-usage>), a tuple with the <success> flag as first item + and a dict reflecting the relative server usage + @rtype: C{tuple} + """ _success, server_list = call_broker_agent(username, task='findbusyservers', remote_agent=remote_agent, **kwargs) @@ -343,9 +360,13 @@ def checkload(remote_agent=None, **kwargs): Query X2Go Broker Agent for a summary of system load specific parameters. - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: (<success>, <load-factor>), a tuple with the <success> flag as first item + and the queried server's load factor as second item + @rtype: C{tuple} + """ _success, _load_params = call_broker_agent('foo', task='checkload', remote_agent=remote_agent, **kwargs) @@ -362,6 +383,7 @@ def checkload(remote_agent=None, **kwargs): pass return load_factor +tasks['checkload'] = checkload def add_authorized_key(username, pubkey_hash, authorized_keys_file='%h/.x2go/authorized_keys', remote_agent=None, **kwargs): """\ @@ -373,9 +395,12 @@ def add_authorized_key(username, pubkey_hash, authorized_keys_file='%h/.x2go/aut @type pubkey_hash: C{unicode} @param authorized_keys_file: the full path to the remote X2Go server's authorized_keys file @type authorized_keys_file: C{unicode} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: (<success>, ), a tuple with the <success> flag as first item + @rtype: C{tuple} + """ return call_broker_agent(username, task='addauthkey', cmdline_args=[pubkey_hash, authorized_keys_file, ], remote_agent=remote_agent, **kwargs) tasks['addauthkey'] = add_authorized_key @@ -391,9 +416,12 @@ def delete_authorized_key(username, pubkey_hash, authorized_keys_file='%h/.x2go/ @type pubkey_hash: C{unicode} @param authorized_keys_file: the full path to the remote X2Go server's authorized_keys file @type authorized_keys_file: C{unicode} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: (<success>, ), a tuple with the <success> flag as first item + @rtype: C{tuple} + """ # this is for the logger output if remote_agent in ('LOCAL', None): @@ -418,9 +446,13 @@ def get_servers(username, remote_agent=None, **kwargs): @param username: run the query on behalf of this username @type username: C{unicode} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: (<success>, <server-list>), a tuple with the <success> flag as first item + and the list of used X2Go Servers as second item + @rtype: C{tuple} + """ return call_broker_agent(username, task='getservers', remote_agent=remote_agent, **kwargs) tasks['getservers'] = get_servers @@ -435,9 +467,13 @@ def tasks_available(username, remote_agent=None, **kwargs): @param username: run the query on behalf of this username @type username: C{unicode} - @param remote_agent: information about the remote agent that is to be called. + @param remote_agent: information about the remote agent that is to be called @type remote_agent: C{dict} + @return: (<success>, <server-list>), a tuple with the <success> flag as first item + and a list of available broker agent tasks as second item + @rtype: C{tuple} + """ return call_broker_agent(username, task='availabletasks', remote_agent=remote_agent, **kwargs) tasks['availabletasks'] = tasks_available @@ -454,6 +490,9 @@ def genkeypair(local_username, client_address, key_type='RSA'): @param key_type: either of: RSA, DSA @type key_type: C{unicode} + @return: two-item tuple: (<pubkey>, <privkey>) + @rtype: C{tuple} + """ key = None pubkey = None @@ -483,4 +522,3 @@ def genkeypair(local_username, client_address, key_type='RSA'): privkey = privkey_obj.getvalue() return (pubkey, privkey) - -- Alioth's /srv/git/code.x2go.org/x2gobroker.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git