From 7374e8b1e24287f40e27d7b471ef7b8dc154f387 Mon Sep 17 00:00:00 2001 From: Judd Maltin Date: Mon, 29 Feb 2016 22:29:51 -0500 Subject: [PATCH] Allow arbitrary amount of lines between Subscription Name and Pool ID Change-Id: I9a246181fab70dc96e7280bbad375a3c5f1d6a9c Closes-Bug: #1551424 --- packstack/plugins/prescript_000.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packstack/plugins/prescript_000.py b/packstack/plugins/prescript_000.py index ac795d914..0a1b57168 100644 --- a/packstack/plugins/prescript_000.py +++ b/packstack/plugins/prescript_000.py @@ -1072,9 +1072,10 @@ def run_rhsm_reg(host, username, password, optional=False, proxy_server=None, # subscribe to required channel cmd = ('subscription-manager list --consumed | grep -i openstack || ' 'subscription-manager subscribe --pool %s') - pool = ("$(subscription-manager list --available" - " | grep -m1 -A15 'Red Hat Enterprise Linux OpenStack Platform'" - " | grep -i 'Pool ID:' | awk '{print $3}')") + pool = ("$(subscription-manager list --available | sed -n " + "\'/Red Hat Enterprise Linux OpenStack Platform/, /Pool ID:/" + " { s/Pool ID:[[:space:]]*\\([[:alnum:]]*\\)/\\1/ p} \'" + " | head -1 )") server.append(cmd % pool) if optional: