Bug 699966 - Add an option on rhncfg-manager to ignore missing local files
Summary: Add an option on rhncfg-manager to ignore missing local files
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Clients
Version: 1.5
Hardware: All
OS: All
medium
medium
Target Milestone: ---
Assignee: Marcelo Moreira de Mello
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space15
TreeView+ depends on / blocked
 
Reported: 2011-04-27 05:16 UTC by Marcelo Moreira de Mello
Modified: 2011-07-21 14:43 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2011-07-21 14:43:32 UTC
Embargoed:


Attachments (Terms of Use)
Patch proposed (1.75 KB, patch)
2011-04-27 05:49 UTC, Marcelo Moreira de Mello
no flags Details | Diff
Patch proposed (enhanced) (1.61 KB, patch)
2011-04-27 12:40 UTC, Marcelo Moreira de Mello
no flags Details | Diff

Description Marcelo Moreira de Mello 2011-04-27 05:16:44 UTC
Description of problem:

Add an option on rhncfg-manager command to ignore or continue uploading other files if some local files were missing 

Version-Release number of selected component (if applicable):
Spacewalk 1.5 (nightly build)

How reproducible:
100%


Steps to Reproduce:
1. Create a custom channel

# rhncfg-manager  create-channel test-channel
Creating config channel test-channel
Config channel test-channel created


2. Use rhncfg-manager to upload a file that does not exists locally
# rhncfg-manager  update --channel=test-channel  /etc/shadow /etc/autofss /etc/group /etc/no_exists
No such file `/etc/autofss'
  
Actual results:
Upload fails when missing local files

Expected results:

Add an option which allows to continue the operation on missing files

Comment 1 Marcelo Moreira de Mello 2011-04-27 05:49:25 UTC
Created attachment 495111 [details]
Patch proposed

Hello, 

This patch allows to use --force option in rhncfg-manager to ignore missing local files when adding or uploading files. 

[root@server ~]# rhncfg-manager  update --help
usage: rhncfg-manager update [options] file [ file ... ]

options:
  -c CHANNEL, --channel=CHANNEL
                        Upload files in this config channel
  -d DEST_FILE, --dest-file=DEST_FILE
                        Upload the file as this path
  -t TOPDIR, --topdir=TOPDIR
                        Make all files relative to this string
  --delim-start=DELIM_START
                        Start delimiter for variable interpolation
  --delim-end=DELIM_END
                        End delimiter for variable interpolation
  -f, --force           Ignore errors if some local files does not exist
  -h, --help            show this help message and exit

[root@server ~]# rhncfg-manager  update --channel=test-channel  --force /etc/shadow /etc/autofss /etc/group /etc/no_exists
Local file /etc/autofss does not exist. Ignoring file...
Local file /etc/no_exists does not exist. Ignoring file...
Pushing to channel test-channel:
Local file /etc/shadow -> remote file /etc/shadow
Local file /etc/group -> remote file /etc/group

Patch already sent to spacewalk-devel maillist

  Mail thread: https://www.redhat.com/archives/spacewalk-devel/2011-April/msg00101.html

Cheers, 
Marcelo Moreira de Mello

Comment 2 Marcelo Moreira de Mello 2011-04-27 12:40:20 UTC
Created attachment 495218 [details]
Patch proposed (enhanced)

Hello Miroslav and Jan, 

Follow a better patch for BZ#699966 with --ignore-missing and a better logical flow. 

[root@server ~]# rhncfg-manager  update --channel=test2-channel --ignore-missing /etc/hosts /etc/shadow /etc/autofss /etc/group /etc/bunda
Local file /etc/autofss does not exist. Ignoring file...
Local file /etc/bunda does not exist. Ignoring file...
Pushing to channel nega:
Local file /etc/hosts -> remote file /etc/hosts
Local file /etc/shadow -> remote file /etc/shadow
Local file /etc/group -> remote file /etc/group

Cheers, 
Marcelo

Comment 3 Miroslav Suchý 2011-04-28 08:47:03 UTC
Commited as 812793c6c24678e6e362d628ddef225c298f7ead

Comment 4 Jan Pazdziora (Red Hat) 2011-07-19 19:36:45 UTC
This bugzilla is currently MODIFIED, so we believe the fix is in the Spacewalk nightly yum repository at http://spacewalk.redhat.com/yum/nightly/

Therefore, moving ON_QA.

Comment 5 Jan Pazdziora (Red Hat) 2011-07-21 14:43:32 UTC
Spacewalk 1.5 was released.


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