@@ -18,21 +18,22 @@ def cli():
18
18
19
19
@cli .command ()
20
20
@click .option (
21
- "--manifest_category " ,
21
+ "--manifest-category " ,
22
22
type = str ,
23
23
help = "Category of manifest (golden_ticket or robottelo_automation by default)" ,
24
24
)
25
- @click .option ("--allocation_name" , type = str , help = "Name of upstream subscription allocation" )
26
- def get_manifest (manifest_category , allocation_name ):
25
+ @click .option ("--allocation-name" , type = str , help = "Name of upstream subscription allocation" )
26
+ @click .option ("--requester" , type = str , default = None )
27
+ def get_manifest (manifest_category , allocation_name , requester ):
27
28
"""Return a subscription manifester based on the settings for the provided manifest_category."""
28
- manifester = Manifester (manifest_category , allocation_name , cli = True )
29
+ manifester = Manifester (manifest_category , allocation_name , requester = requester )
29
30
manifester .create_subscription_allocation ()
30
31
for sub in manifester .subscription_data :
31
32
manifester .process_subscription_pools (
32
33
subscription_pools = manifester .subscription_pools ,
33
34
subscription_data = sub ,
34
35
)
35
- manifester .trigger_manifest_export ()
36
+ return manifester .trigger_manifest_export ()
36
37
37
38
38
39
@cli .command ()
@@ -54,14 +55,14 @@ def delete(allocations, all_, remove_manifest_file):
54
55
"""Delete subscription allocations in inventory and optionally delete local manifest files."""
55
56
inv = helpers .load_inventory_file (Path (settings .inventory_path ))
56
57
for num , allocation in enumerate (inv ):
57
- if remove_manifest_file :
58
- Path (
59
- f"{ os .environ ['MANIFESTER_DIRECTORY' ]} /manifests/{ allocation .get ('name' )} _manifest.zip"
60
- ).unlink ()
61
58
if str (num ) in allocations or allocation .get ("name" ) in allocations or all_ :
62
59
Manifester (minimal_init = True ).delete_subscription_allocation (
63
60
uuid = allocation .get ("uuid" )
64
61
)
62
+ if remove_manifest_file :
63
+ Path (
64
+ f"{ os .environ ['MANIFESTER_DIRECTORY' ]} /manifests/{ allocation .get ('name' )} _manifest.zip"
65
+ ).unlink ()
65
66
66
67
67
68
@cli .command ()
0 commit comments