Bug 699966

Summary: Add an option on rhncfg-manager to ignore missing local files
Product: [Community] Spacewalk Reporter: Marcelo Moreira de Mello <mmello>
Component: ClientsAssignee: Marcelo Moreira de Mello <mmello>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.5CC: mmello, msuchy
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 14:43:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 695242    
Attachments:
Description Flags
Patch proposed
none
Patch proposed (enhanced) none

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.