File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+
3
+ import http .client
4
+ http .client ._MAXHEADERS = 1000
5
+
6
+ import argparse
7
+ import copy
8
+ from datetime import datetime
9
+ import json
10
+ import logging
11
+ import sys
12
+ import timestring
13
+
14
+ from blackduck .HubRestApi import HubInstance , object_id
15
+
16
+ parser = argparse .ArgumentParser ("Add a sub-project to a project" )
17
+ parser .add_argument ("parent_project" )
18
+ parser .add_argument ("parent_version" )
19
+ parser .add_argument ("sub_project" )
20
+ parser .add_argument ("sub_version" )
21
+ args = parser .parse_args ()
22
+
23
+ logging .basicConfig (format = '%(asctime)s:%(levelname)s:%(message)s' , stream = sys .stderr , level = logging .DEBUG )
24
+ logging .getLogger ("requests" ).setLevel (logging .WARNING )
25
+ logging .getLogger ("urllib3" ).setLevel (logging .WARNING )
26
+
27
+ hub = HubInstance ()
28
+
29
+ parent_project = hub .get_project_version_by_name (args .parent_project , args .parent_version )
30
+ sub_project = hub .get_project_version_by_name (args .sub_project , args .sub_version )
31
+
32
+ hub .add_version_as_component (parent_project , sub_project )
You can’t perform that action at this time.
0 commit comments