Project

General

Profile

Actions

Bug #8824

closed

Zypper repo management "Delete all other repositories than those managed by Rudder" is broken

Added by Janos Matya over 4 years ago. Updated about 4 years ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Severity:
User visibility:
Effort required:
Priority:

Description

G'day.

Found apparently a bug in the SLES Zypper repo management technique:

https://github.com/Normation/rudder-techniques/blob/master/techniques/applications/zypperPackageManagerRepositories/1.0/zypper-repositories-management.st#L67

=> Here there is an additional * after the ., which I belive is unnecessary.

At least with empirical tests, with the star I have this output on the repo list I want to clean up:

2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-repo.site.corp-801fb2a6.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-10.xx.xx.xx-699e6d28.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-repo.site.corp-604618f7.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-repo.site.corp-00774129.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-repo.site.corp-807541a0.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/rudder-active-P-Storage-1.0-PTF.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-10.xx.xx.xx-8a5f7779.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-repo.site.corp-61481be6.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-repo.site.corp-334fdb3f.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-repo.site.corp-085864a6.repo' that is not a directory
2016-08-08T14:48:01+0200  warning: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.:'[0]: depth_search (recursion) is promised for a base object '/etc/zypp/repos.d/http-repo.site.corp-64d041fa.repo' that is not a directory

Without the star it works as designed:

2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-repo.site.corp-801fb2a6.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-10.xx.xx.xx-699e6d28.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-repo.site.corp-604618f7.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-repo.site.corp-00774129.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-repo.site.corp-807541a0.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./rudder-active-P-Storage-1.0-PTF.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-10.xx.xx.xx-8a5f7779.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-repo.site.corp-61481be6.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-repo.site.corp-334fdb3f.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-repo.site.corp-085864a6.repo'
2016-08-08T15:06:41+0200     info: /default/zypper_repositories_management/files/'/etc/zypp/repos.d/.'[0]: Deleted file '/etc/zypp/repos.d/./http-repo.site.corp-64d041fa.repo'

Here is the proposed diff:

# diff -u zypper-repositories-management.cf.*
--- zypper-repositories-management.cf.bad       2016-08-08 15:14:17.794177601 +0200
+++ zypper-repositories-management.cf.ok        2016-08-08 15:13:52.653494916 +0200
@@ -76,7 +76,7 @@

     SuSE.zypper_disable_other_repositories::

-      "/etc/zypp/repos.d/.*" 
+      "/etc/zypp/repos.d/." 
         delete       => tidy,
         file_select  => ex_list("@{zypper_files}"),
         depth_search => recurse("inf"),

Actions

Also available in: Atom PDF