def create_user(name, password, *privileges):
 _priv = ['ADMIN_PRIV', 'REMOTE_CONS_PRIV', 'RESET_SERVER_PRIV', 'VIRTUAL_MEDIA_PRIV', 'CONFIG_ILO_PRIV']
 _xml = '<RIBCL version="2.2">\n                <LOGIN USER_LOGIN="x" PASSWORD="y">\n                  <RIB_INFO mode="write">\n                    <MOD_GLOBAL_SETTINGS>\n                      <MIN_PASSWORD VALUE="7"/>\n                    </MOD_GLOBAL_SETTINGS>\n                  </RIB_INFO>\n\n                 <USER_INFO MODE="write">\n                   <ADD_USER USER_NAME="{0}" USER_LOGIN="{0}" PASSWORD="{1}">\n                     {2}\n                   </ADD_USER>\n                 </USER_INFO>\n               </LOGIN>\n             </RIBCL>'.format(name, password, '\n'.join(['<{0} value="Y" />'.format(i.upper()) for i in privileges if (i.upper() in _priv)]))
 return __execute_cmd('Create_user', _xml)

def create_user ( name , password , * privileges ) : _priv = [ 'ADMIN_PRIV' , 'REMOTE_CONS_PRIV' , 'RESET_SERVER_PRIV' , 'VIRTUAL_MEDIA_PRIV' , 'CONFIG_ILO_PRIV' ] _xml = '<RIBCL version="2.2">\n                <LOGIN USER_LOGIN="x" PASSWORD="y">\n                  <RIB_INFO mode="write">\n                    <MOD_GLOBAL_SETTINGS>\n                      <MIN_PASSWORD VALUE="7"/>\n                    </MOD_GLOBAL_SETTINGS>\n                  </RIB_INFO>\n\n                 <USER_INFO MODE="write">\n                   <ADD_USER USER_NAME="{0}" USER_LOGIN="{0}" PASSWORD="{1}">\n                     {2}\n                   </ADD_USER>\n                 </USER_INFO>\n               </LOGIN>\n             </RIBCL>' . format ( name , password , '\n' . join ( [ '<{0} value="Y" />' . format ( i . upper ( ) ) for i in privileges if ( i . upper ( ) in _priv ) ] ) ) return __execute_cmd ( 'Create_user' , _xml )
create/ensure a user is created with provided settings .