Alex Lourie has uploaded a new change for review. Change subject: packaging: setup: add read user validation for alphanumeric chars ......................................................................
packaging: setup: add read user validation for alphanumeric chars Change-Id: Ia7389e7a0394fa08aa39ce9f4d93fa69b10e5ab7 Bug-Url: https://bugzilla.redhat.com/1037861 Signed-off-by: Alex Lourie <alou...@redhat.com> --- M packaging/common_utils.py 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-dwh refs/changes/58/22158/1 diff --git a/packaging/common_utils.py b/packaging/common_utils.py index 28f50b5..6268632 100755 --- a/packaging/common_utils.py +++ b/packaging/common_utils.py @@ -1428,7 +1428,7 @@ 'engine_reports' ): print ( - '{user} is a reserved username and cannot be used ' + 'Error: {user} is a reserved username and cannot be used ' 'for creating read only user.' ).format( user=user @@ -1436,6 +1436,11 @@ return False if len(user) == 0: + print 'Error: user name cannot be empty' + return False + + if re.search(r"\W", user): + print 'Error: user name can only include alphanumeric characters' return False sql_query = '"select 1 from pg_roles where rolname=\'{user}\';"'.format( -- To view, visit http://gerrit.ovirt.org/22158 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7389e7a0394fa08aa39ce9f4d93fa69b10e5ab7 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-dwh Gerrit-Branch: master Gerrit-Owner: Alex Lourie <alou...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches