fixed bug with empty user list

Change-Id: I217b26727c1ab447d128186d245051445c13718f
diff --git a/README.rst b/README.rst
index bfc9644..af1b44e 100644
--- a/README.rst
+++ b/README.rst
@@ -58,8 +58,7 @@
       environment:
         enabled: true
         user:
-        - root:
-            name: root
+          root:
             pypi_user: user
             pypi_password: password
             pypi_mirror:
diff --git a/python/environment.sls b/python/environment.sls
index cbb508b..24969c4 100644
--- a/python/environment.sls
+++ b/python/environment.sls
@@ -16,8 +16,8 @@
 
 {%- endif %}
 
-{%- for user in environment.user %}
-{% set user_home = salt['user.info'](user.name).get('home') %}
+{%- for user_name, user in environment.get('user',{}).iteritems() %}
+{% set user_home = salt['user.info'](user_name).get('home') %}
 
 {%- if network.proxy.host == 'none' and user.pypi_mirror is not defined %}