From 6eb9dc436f97e567a5ef67b01b78cab624461ba7 Mon Sep 17 00:00:00 2001 From: Kload Date: Sat, 6 Jul 2013 10:59:06 +0000 Subject: [PATCH] Bugfix --- yunohost_app.py | 14 +++++++------- yunohost_domain.py | 2 +- yunohost_dyndns.py | 6 +++--- yunohost_firewall.py | 4 ++-- yunohost_monitor.py | 30 +++++++++++++++++++++++++++--- yunohost_tools.py | 2 +- yunohost_user.py | 18 +++++++++--------- 7 files changed, 50 insertions(+), 26 deletions(-) diff --git a/yunohost_app.py b/yunohost_app.py index 1576632e..ae5d6a22 100644 --- a/yunohost_app.py +++ b/yunohost_app.py @@ -106,10 +106,10 @@ def app_list(offset=None, limit=None, filter=None, raw=False): List apps Keyword argument: - raw -- Return the full app_dict limit -- Maximum number of app fetched offset -- Starting number for app fetching filter -- Name filter of app_id or app_name + raw -- Return the full app_dict """ # TODO: List installed applications @@ -165,9 +165,9 @@ def app_info(app, instance=None, raw=False): Get app informations Keyword argument: + app -- App ID instance -- App instance number raw -- Return the full app_dict - app -- App ID """ try: @@ -233,10 +233,10 @@ def app_upgrade(app, instance=[], url=None, file=None): Upgrade app Keyword argument: - instance -- App instance number to upgrade url -- Git url to fetch for upgrade app -- App(s) to upgrade (default all) file -- Folder or tarball for upgrade + instance -- App instance number to upgrade """ with YunoHostLDAP() as yldap: @@ -377,10 +377,10 @@ def app_install(app, domain, path='/', label=None, mode='private'): Install apps Keyword argument: - path mode -- level of privacy of the app (public|protected|private) domain app -- App to install + path label """ @@ -598,8 +598,8 @@ def app_remove(app, instance=[]): Remove app Keyword argument: - instance -- App instance number to delete app -- App(s) to delete + instance -- App instance number to delete """ lemon_conf_lines = {} @@ -662,8 +662,8 @@ def app_addaccess(apps, users): Grant access right to users (everyone by default) Keyword argument: - apps users + apps """ if not isinstance(users, list): users = [users] @@ -711,8 +711,8 @@ def app_removeaccess(apps, users): Revoke access right to users (everyone by default) Keyword argument: - apps users + apps """ if not isinstance(users, list): users = [users] diff --git a/yunohost_domain.py b/yunohost_domain.py index 3a259993..84d30813 100644 --- a/yunohost_domain.py +++ b/yunohost_domain.py @@ -72,8 +72,8 @@ def domain_add(domains, raw=False, main=False): Create a custom domain Keyword argument: - raw -- Auto-configure Apache and LemonLDAP for the domain domains -- Domain name to add + raw -- Auto-configure Apache and LemonLDAP for the domain """ with YunoHostLDAP() as yldap: diff --git a/yunohost_dyndns.py b/yunohost_dyndns.py index 902227fe..756d54b9 100644 --- a/yunohost_dyndns.py +++ b/yunohost_dyndns.py @@ -35,9 +35,9 @@ def dyndns_subscribe(subscribe_host="dyndns.yunohost.org", domain=None, key=None Subscribe to a DynDNS service Keyword argument: - key -- Public DNS key - subscribe_host -- Dynette HTTP API to subscribe to domain -- Full domain to subscribe with + subscribe_host -- Dynette HTTP API to subscribe to + key -- Public DNS key """ if domain is None: @@ -75,9 +75,9 @@ def dyndns_update(dyn_host="dynhost.yunohost.org", domain=None, key=None, ip=Non Keyword argument: dyn_host -- Dynette DNS server to inform + domain -- Full domain to subscribe with ip -- IP address to send key -- Public DNS key - domain -- Full domain to subscribe with """ if domain is None: diff --git a/yunohost_firewall.py b/yunohost_firewall.py index 705ad27a..98b4dc3f 100644 --- a/yunohost_firewall.py +++ b/yunohost_firewall.py @@ -45,9 +45,9 @@ def firewall_allow(protocol=None, port=None, ipv6=None, upnp=False): Allow connection port/protocol Keyword argument: + upnp -- upnp protocol -- Protocol associated with port ipv6 -- ipv6 - upnp -- upnp port -- Port to open """ @@ -76,9 +76,9 @@ def firewall_disallow(protocol=None, port=None, ipv6=None, upnp=False): Disallow connection Keyword argument: + upnp -- upnp protocol -- Protocol associated with port ipv6 -- ipv6 - upnp -- upnp port -- Port to open """ diff --git a/yunohost_monitor.py b/yunohost_monitor.py index 2d53c7f9..c46c48d4 100644 --- a/yunohost_monitor.py +++ b/yunohost_monitor.py @@ -91,12 +91,12 @@ def monitor_info(memory=False, cpu=False, disk=False, ifconfig=False, uptime=Fal Check System Keyword argument: - public -- Show IP public - cpu -- Check CPU uptime -- Show Uptime disk -- Check Disk - ifconfig -- Show Ip and MAC Adress + public -- Show IP public + cpu -- Check CPU memory -- Check Memory + ifconfig -- Show Ip and MAC Adress """ if memory: @@ -138,3 +138,27 @@ def monitor_info(memory=False, cpu=False, disk=False, ifconfig=False, uptime=Fal raise YunoHostError(1, _('No arguments provided')) def monitor_process(enable=None, disable=None, start=None, stop=None, check=None, info=False): + """ + Check Process + + Keyword argument: + enable -- Enable process + disable -- Disable process + stop -- Stop process + check -- Check process + info -- Process info + start -- Start process + + """ + if enable: + return process_enable(enable) + elif disable: + return process_disable(disable) + elif start: + return process_start(start) + elif stop: + return process_stop(stop) + elif check: + return process_check(check) + elif info: + return json.loads(s.getProcessCount()) diff --git a/yunohost_tools.py b/yunohost_tools.py index 34f77bb6..17cc2cac 100644 --- a/yunohost_tools.py +++ b/yunohost_tools.py @@ -176,9 +176,9 @@ def tools_postinstall(domain, password, dyndns=False): YunoHost post-install Keyword argument: - password -- YunoHost admin password dyndns -- Subscribe domain to a DynDNS service domain -- YunoHost main domain + password -- YunoHost admin password """ with YunoHostLDAP(password='yunohost') as yldap: diff --git a/yunohost_user.py b/yunohost_user.py index b1ff57f0..e5112ffe 100644 --- a/yunohost_user.py +++ b/yunohost_user.py @@ -39,9 +39,9 @@ def user_list(fields=None, filter=None, limit=None, offset=None): Keyword argument: fields -- fields to fetch - limit -- Maximum number of user fetched offset -- Starting number for user fetching filter -- LDAP filter used to search + limit -- Maximum number of user fetched """ with YunoHostLDAP() as yldap: @@ -92,11 +92,11 @@ def user_create(username, firstname, lastname, mail, password): Create user Keyword argument: - password - firstname - mail -- Main mail address must be unique - lastname username -- Must be unique + lastname + firstname + password + mail -- Main mail address must be unique """ with YunoHostLDAP() as yldap: @@ -160,15 +160,15 @@ def user_update(username, firstname=None, lastname=None, mail=None, change_passw Update user informations Keyword argument: - remove_mailalias -- Mail aliases to remove - change_password -- New password to set username -- Username of user to update - remove_mailforward -- Mailforward addresses to remove - add_mailforward -- Mailforward addresses to add firstname add_mailalias -- Mail aliases to add mail lastname + change_password -- New password to set + remove_mailalias -- Mail aliases to remove + add_mailforward -- Mailforward addresses to add + remove_mailforward -- Mailforward addresses to remove """ with YunoHostLDAP() as yldap: