Bug 700827 - Behaviour should be consistent while uploading a .txt file in custom repo
Summary: Behaviour should be consistent while uploading a .txt file in custom repo
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 2.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Jay Dobies
QA Contact: wes hayutin
URL:
Whiteboard:
Depends On:
Blocks: 688298
TreeView+ depends on / blocked
 
Reported: 2011-04-29 14:09 UTC by Sachin Ghai
Modified: 2012-05-31 12:56 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-31 12:56:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sachin Ghai 2011-04-29 14:09:15 UTC
Description of problem:
When I tried to pass bunch of rpms from a directory location along with a .txt file. I was able to upload it. 

However when i tied it with specifying the file location, its says "Only RPM may be uploaded" 

Version-Release number of selected component (if applicable):
pulp 0.171
rhui-tools 2.0.22

How reproducible:
Always

Steps to Reproduce:
1. create custom repo
2. specify the directory location that includes bunch of .rpm packages and a .txt file
  
Actual results:
I can upload a txt file with bunch of rpms from a directory location. However when I tried to upload a txt file through file location, it says "Only RPM may be uploaded" 

Expected results:
Ideally we should be able to upload only rpms.
If .rpm files are supported to upload then it should not upload .txt file with bunch of rpms.

From both ways (with file location and directory location) it should be consistent.

Additional info:

See the text.txt file in below output: This is while uploading rpms from directory location:

Uploading /root/packages/python-qpid-0.7.946106-1.el6.noarch.rpm...
Uploading /root/packages/pulp-0.0.156-1.el6.noarch.rpm...
Uploading /root/packages/qpid-cpp-server-0.10-1.el6.x86_64.rpm...
Uploading /root/packages/qpid-cpp-server-ssl-0.10-1.el6.x86_64.rpm...

Uploading /root/packages/text.txt...

Uploading /root/packages/python-gofer-0.25-1.el6.noarch.rpm...
Uploading /root/packages/pulp-client-0.0.156-1.el6.noarch.rpm...
Uploading /root/packages/qpid-cpp-server-store-0.10-1.el6.x86_64.rpm...
Uploading /root/packages/python-oauth2-1.2.1-3.el6.noarch.rpm...
Uploading /root/packages/grinder-0.0.88-1.el6.noarch.rpm...
Uploading /root/packages/pulp-common-0.0.156-1.el6.noarch.rpm...
Uploading /root/packages/qpid-cpp-client-0.10-1.el6.x86_64.rpm...
Uploading /root/packages/ruby-gofer-0.25-1.el6.noarch.rpm...
Uploading /root/packages/python-webpy-0.32-8.el6.noarch.rpm...
Uploading /root/packages/qpid-cpp-client-ssl-0.10-1.el6.x86_64.rpm...
Uploading /root/packages/pulp-cds-0.0.156-1.el6.noarch.rpm...
Uploading /root/packages/gofer-0.25-1.el6.noarch.rpm...

------------------------------------------------------------------------------
rhui (repo) =>


Uploading txt file by specifying the file location:
======================================================

However, when we upload a .txt file with an absolute path like following; we got a message "Only RPMs may be uploaded".

Enter the location of the packages to upload. If the location is an RPM,
the file will be uploaded. If the location is a directory, all RPMs in that
directory will be uploaded:
/root/packages/hello.txt

Only RPMs may be uploaded


When we upload a text file with bunch of rpms then text file stored under /var/lib/pulp/files/e3b directory
[root@dhcp193-23 ~]# cd /var/lib/pulp/files/
[root@dhcp193-23 files]# ls
e3b
[root@dhcp193-23 files]# cd e3b/
[root@dhcp193-23 e3b]# ls
text.txt
[root@dhcp193-23 e3b]#

Curious to know about the e3b directory, why we named this directory as "e3b" ?

Comment 1 Jay Dobies 2011-05-09 19:39:43 UTC
Great find :)

commit ac03ab610cb9b915afeb57f173bc543574cc7706
Author: Jay Dobies <jason.dobies>
Date:   Mon May 9 15:37:14 2011 -0400

    Only pull in RPM files when adding a directory of RPMs.

rhui-2.0/tools/src/rhui/tools/commands/packages.py
rhui-2.0/tools/src/rhui/tools/screens/repo.py

Comment 2 Jay Dobies 2011-05-24 12:11:24 UTC
Fixed in 2.0.23.

Comment 3 Sachin Ghai 2011-05-25 08:24:43 UTC
Verified in 
rhui-tools 2.0.25
pulp 0.179

Now I can upload only RPM files when adding from a directry. I included some other files and it has discarded them.




[root@dhcp193-136 package1]# ls -l
total 2404
-rw-r--r--. 1 root root      0 May 25 08:07 hello.bmp
-rw-r--r--. 1 root root      0 May 25 08:07 hello.cvv
-rw-r--r--. 1 root root      0 May 25 08:07 hello.test
-rw-r--r--. 1 root root 998400 May  9 09:03 qpid-cpp-client-0.10-1.el6.x86_64.rpm
-rw-r--r--. 1 root root 103364 May  9 09:03 qpid-cpp-client-ssl-0.10-1.el6.x86_64.rpm
-rw-r--r--. 1 root root 951912 May  9 09:03 qpid-cpp-server-0.10-1.el6.x86_64.rpm
-rw-r--r--. 1 root root  51344 May  9 09:03 qpid-cpp-server-ssl-0.10-1.el6.x86_64.rpm
-rw-r--r--. 1 root root 345356 May  9 09:03 qpid-cpp-server-store-0.10-1.el6.x86_64.rpm
[root@dhcp193-136 package1]# 



rhui (repo) => u

Select the repositories to upload the package into:
  -  1 : repo2_test
  -  2 : repo157
Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: 1

Select the repositories to upload the package into:
  x  1 : repo2_test
  -  2 : repo157
Enter value (1-2) to toggle selection, 'c' to confirm selections, or '?' for more commands: c


Enter the location of the packages to upload. If the location is an RPM,
the file will be uploaded. If the location is a directory, all RPMs in that
directory will be uploaded:
/root/package1

The following RPMs will be uploaded:
  qpid-cpp-server-0.10-1.el6.x86_64.rpm
  qpid-cpp-server-ssl-0.10-1.el6.x86_64.rpm
  qpid-cpp-server-store-0.10-1.el6.x86_64.rpm
  qpid-cpp-client-0.10-1.el6.x86_64.rpm
  qpid-cpp-client-ssl-0.10-1.el6.x86_64.rpm
Proceed? (y/n) y


Uploading /root/package1/qpid-cpp-server-0.10-1.el6.x86_64.rpm...
Uploading /root/package1/qpid-cpp-server-ssl-0.10-1.el6.x86_64.rpm...
Uploading /root/package1/qpid-cpp-server-store-0.10-1.el6.x86_64.rpm...
Uploading /root/package1/qpid-cpp-client-0.10-1.el6.x86_64.rpm...
Uploading /root/package1/qpid-cpp-client-ssl-0.10-1.el6.x86_64.rpm...

------------------------------------------------------------------------------
rhui (repo) =>

Comment 4 wes hayutin 2011-08-01 21:40:28 UTC
moving to release pending

Comment 5 wes hayutin 2012-05-31 12:56:55 UTC
closing out, product released


Note You need to log in before you can comment on or make changes to this bug.