Bug 790791

Summary: Creating a repo with relative path containing space fails with error
Product: [Retired] Pulp Reporter: Ivan Necas <inecas>
Component: user-experienceAssignee: Sayli Karmarkar <skarmark>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: high Docs Contact:
Priority: unspecified    
Version: 1.0.0CC: cperry, skarmark
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Ivan Necas 2012-02-15 12:09:12 UTC
Version-Release number of selected component (if applicable):
pulp-0.0.265-1.fc15.noarch


How reproducible:
Always

Steps to Reproduce:
1. Create a repo with replatve_path containing space

Actual results:

2012-02-15 12:59:49,968 7453:139856147642112: pulp.server.webservices.controllers.decorators:ERROR: decorators:52 Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 48, in report_error
    return method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py", line 127, in _auth_decorator
    value = method(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/repositories.py", line 2120, in POST
    return action(id)
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/repositories.py", line 1377, in clone
    publish=repo_data.get('publish', None))
  File "/usr/lib/python2.7/site-packages/pulp/server/api/repo_sync.py", line 99, in clone
    content_types=content_types, publish=publish)
  File "/usr/lib/python2.7/site-packages/pulp/server/api/repo.py", line 324, in create
    pulp.server.util.create_repo(repo_path, checksum_type=r['checksum_type'])
  File "/usr/lib/python2.7/site-packages/pulp/server/util.py", line 552, in create_repo
    raise CreateRepoError(err_msg)
CreateRepoError: Error: Only one directory allowed per run.
  
Expected results:
Successfully created repository

Comment 1 Sayli Karmarkar 2012-02-15 20:04:31 UTC
We have decided not to allow whitespace characters in repo id and relative path
for repositories, so fix for this contains regex checking and ValidationError
when repo id, clone id or relative path contains whitespace characters in it. 

commit 4bd79f12c3b609f9b150b62822d4d09cdc606581
Author: Sayli Karmarkar <skarmark>
Date:   Wed Feb 15 11:59:40 2012 -0800

    789083, 790838, 790791 - Added regex checking and validation error when
repo id or relative path contains whitespace characters

$ sudo pulp-admin repo clone --id test --clone_id "test_clone" --relativepath "
test_whitespace "
error:  operation failed: PulpValidationError: Given relative_path:[
test_whitespace ] is invalid. relative_path should not contain whitespace
characters.

Comment 2 Jeff Ortel 2012-02-17 17:18:01 UTC
build: 0.267

Comment 3 Preethi Thomas 2012-02-17 18:56:19 UTC
verified
[root@preethi ~]# rpm -q pulp
pulp-0.0.267-1.fc15.noarch
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]#  pulp-admin repo clone --id spacewalk --clone_id "test_clone" --relativepath "
test_whitespace "
error:  operation failed: test_whitespace ] is invalid. relative_path should not contain whitespace characters.
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]#  pulp-admin repo clone --id spacewalk --clone_id "test clone" --relativepath "test_whitespace "
error:  operation failed: PulpValidationError: Given clone_id:[test clone] is invalid. clone_id should not contain whitespace characters.
[root@preethi ~]#

Comment 4 Preethi Thomas 2012-02-24 20:17:21 UTC
Pulp v1.0 is released
Closed Current Release.

Comment 5 Preethi Thomas 2012-02-24 20:18:23 UTC
Pulp v1.0 is released.