Make fullname an optional argument
diff --git a/_states/gerrit.py b/_states/gerrit.py
index ebd9c6d..47969da 100644
--- a/_states/gerrit.py
+++ b/_states/gerrit.py
@@ -22,10 +22,10 @@
return 'gerrit' if 'gerrit.account_create' in __salt__ else False
-def account_present(name, fullname, email=None, active=None, groups=[], ssh_key=None, http_password=None, **kwargs):
+def account_present(name, fullname=None, email=None, active=None, groups=[], ssh_key=None, http_password=None, **kwargs):
'''
Ensures that the gerrit account exists
-
+
:param name: username
:param fullname: fullname
:param email: email
@@ -62,7 +62,7 @@
def group_present(name, description=None, **kwargs):
'''
Ensures that the gerrit group exists
-
+
:param name: group name
'''
ret = {'name': name,
@@ -87,7 +87,7 @@
def project_present(name, description=None, **kwargs):
'''
Ensures that the gerrit project exists
-
+
:param name: project name
:param description: short project description
'''
diff --git a/gerrit/client/user.sls b/gerrit/client/user.sls
index e8a2ad8..c79285b 100644
--- a/gerrit/client/user.sls
+++ b/gerrit/client/user.sls
@@ -6,7 +6,9 @@
gerrit_client_account_{{ account_name }}:
gerrit.account_present:
- name: {{ account_name }}
+ {%- if account.fullname is defined %}
- fullname: {{ account.fullname }}
+ {%- endif %}
- active: {{ account.get('active', True) }}
{%- if account.email is defined %}
- email: {{ account.email }}
@@ -26,4 +28,4 @@
{%- endfor %}
-{%- endif %}
\ No newline at end of file
+{%- endif %}
diff --git a/gerrit/meta/sphinx.yml b/gerrit/meta/sphinx.yml
index 2d93205..49dec6d 100644
--- a/gerrit/meta/sphinx.yml
+++ b/gerrit/meta/sphinx.yml
@@ -22,7 +22,7 @@
users:
value:
{%- for name, user in client.user.iteritems() %}
- - "{{ name }} ({{ user.fullname }})"
+ - "{{ name }}{% if user.fullname is defined %} ({{ user.fullname }}){% endif %}"
{%- endfor %}
{%- endif %}
{%- endif %}