Skip to content

Commit 9e39355

Browse files
committed
new-version: handle RHCEPH and RHSCON products
Prior to this change, on rhscon-* or ceph-* dist-git branches, the "rdopkg new-version" command would try to use fedpkg to upload sources, rather than rhpkg. This meant that rdopkg would upload to the wrong dist-git lookaside cache (or just fail to upload altogether). The problem is that guess.osdist() could only return "RHOS" for Red Hat OpenStack Platform dist-git branches. rdopkg would assume any other dist-git branches were "RDO". Update guess.osdist() to return more products than just RHOS. These now show up properly in "rdopkg pkgenv". Generalize new-version's rhpkg decision by simply checking if osdist begins with the letters "RH". Change-Id: Ic573c47265a3ee4f55a73dfe82eaec9453840398
1 parent 78d720a commit 9e39355

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

doc/rdopkg.1.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ Don't forget to `git fetch --all` before running the action.
141141

142142
You can use the `-N`/`--new-sources` or `-n`/`--no-new-sources` options to
143143
control whether `new-version` will run `fedpkg new-sources`
144-
(`rhpkg new-sources` on RHOS). By default, `rdopkg` will automatically enable
145-
or disable this step based on the dist-git branch name. RHOS branches
146-
(`rhos-*` or `rh-*`) default to `-N`. All other branches default to `-n`.
144+
(`rhpkg new-sources` on Red Hat downstream products). By default, `rdopkg`
145+
will automatically enable or disable this step based on the dist-git branch
146+
name. RH dist-git branches (`rhos-*`, `rh-*`, `ceph-*`, `rhscon-*`) default to
147+
`-N`. All other branches default to `-n`.
147148

148149
After running `rdopkg new-version`, new commit will contain the changes.
149150

rdopkg/actions/distgit/actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ def get_package_env(version=None, release=None, dist=None, branch=None,
4242
'branch': branch,
4343
}
4444
osdist = guess.osdist()
45-
if osdist == 'RHOS':
46-
log.info("RHOS package detected.")
45+
if osdist.startswith('RH'):
46+
log.info("RH package detected.")
4747
args['fedpkg'] = ['rhpkg']
4848
if not patches_branch:
4949
patches_branch = guess.patches_branch(branch, pkg=args['package'],

rdopkg/guess.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,15 @@ def builds(release):
239239

240240

241241
def osdist(branch=None):
242-
# which OpenStack/packaging distribution?
242+
# which package distribution?
243243
if branch is None:
244244
branch = current_branch(default='')
245245
if branch.startswith('rhos-') or branch.startswith('rh-'):
246246
return 'RHOS'
247+
if branch.startswith('ceph-'):
248+
return 'RHCEPH'
249+
if branch.startswith('rhscon-'):
250+
return 'RHSCON'
247251
# XXX Detect 'Fedora' here? From r'f\d+' branches possibly.
248252
return 'RDO'
249253

@@ -252,7 +256,7 @@ def new_sources(_osdist=None):
252256
# shall we run `$RPKG new-sources`?
253257
if not _osdist:
254258
_osdist = osdist()
255-
if _osdist == 'RHOS':
259+
if _osdist.startswith('RH'):
256260
# XXX: Fedora might also benefit from True
257261
# once osdist() detects it properly.
258262
return True

0 commit comments

Comments
 (0)