[redhat_subscription]: fixed force option. (#20667)

`force` option is not unique for non-activationkey registrations and it should
be parsed separately; it is possible to register host with activation key and
force such process.
This commit is contained in:
Kamil Boratyński 2017-01-26 19:28:24 +01:00 committed by Adrian Likins
parent 47892a0034
commit 9d8c1923ab

View file

@ -292,6 +292,9 @@ class Rhsm(RegistrationBase):
args = [SUBMAN_CMD, 'register'] args = [SUBMAN_CMD, 'register']
# Generate command arguments # Generate command arguments
if force_register:
args.extend(['--force'])
if activationkey: if activationkey:
args.extend(['--activationkey', activationkey]) args.extend(['--activationkey', activationkey])
args.extend(['--org', org_id]) args.extend(['--org', org_id])
@ -308,8 +311,6 @@ class Rhsm(RegistrationBase):
args.extend(['--name', consumer_name]) args.extend(['--name', consumer_name])
if consumer_id: if consumer_id:
args.extend(['--consumerid', consumer_id]) args.extend(['--consumerid', consumer_id])
if force_register:
args.extend(['--force'])
if environment: if environment:
args.extend(['--environment', environment]) args.extend(['--environment', environment])