From d91efb857e18386563251df46c89e32421d8c66d Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Feb 22 2018 14:47:48 +0000 Subject: raise an error if '/' is present in the repo name Fixes #136 Signed-off-by: Tomas Tomecek --- diff --git a/fedrepo_req/fedrepo_req.py b/fedrepo_req/fedrepo_req.py index c95d3d0..aafd449 100644 --- a/fedrepo_req/fedrepo_req.py +++ b/fedrepo_req/fedrepo_req.py @@ -83,6 +83,9 @@ def cli(branch, repo, sl, upstreamurl, ticket, summary, namespace, monitor, 'characters long with only letters, numbers, hyphens, ' 'underscores, plus signs, and/or periods. Please note that the ' 'project cannot start with a period or a plus sign.'.format(repo)) + if "/" in repo: + raise click.ClickException( + 'You should specify namespace via -n argument') module_ns = ['modules', 'test-modules'] if namespace in module_ns and not valid_module_stream_name(branch): diff --git a/fedrepo_req/fedrepo_req_branch.py b/fedrepo_req/fedrepo_req_branch.py index e590369..0a28978 100644 --- a/fedrepo_req/fedrepo_req_branch.py +++ b/fedrepo_req/fedrepo_req_branch.py @@ -80,6 +80,10 @@ def cli(branch, repo, sl, namespace, git_branch): if is_epel(branch) and not valid_epel_package(repo, branch): raise click.ClickException(INVALID_EPEL_ERROR) + if "/" in repo: + raise click.ClickException( + 'You should specify namespace via -n argument') + ticket_body = { 'action': 'new_branch', 'branch': branch,