start-sru-cycle: only start cycle for given series

Message ID 20170405140919.13284-1-cascardo@canonical.com
State New
Headers show

Commit Message

Thadeu Lima de Souza Cascardo April 5, 2017, 2:09 p.m.
If a series is specified, then only start cycles for that. Otherwise, do
all series.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 stable/start-sru-cycle | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Stefan Bader April 5, 2017, 4:15 p.m. | #1

Joseph Salisbury April 5, 2017, 4:26 p.m. | #2

Thadeu Lima de Souza Cascardo April 7, 2017, 1:26 p.m. | #3
Applied to kteam-tools.

Thanks.
Cascardo.

Patch

diff --git a/stable/start-sru-cycle b/stable/start-sru-cycle
index 2459785..daab835 100755
--- a/stable/start-sru-cycle
+++ b/stable/start-sru-cycle
@@ -38,8 +38,10 @@  class Crankers():
         retval = {}
         ubuntu = Ubuntu()
         for series in sorted(ubuntu.index_by_series_name, reverse=True):
-            record = ubuntu.index_by_series_name[series]
-            if record['supported']:
+           record = ubuntu.index_by_series_name[series]
+           if record['supported']:
+                if len(s.args.series) != 0 and series not in s.args.series:
+                    continue
                 retval[series] = {}
                 if 'derivative-packages' in record:
                     for package in record['derivative-packages']:
@@ -144,6 +146,7 @@  if __name__ == '__main__':
 
     parser = ArgumentParser(description=app_description, epilog=app_epilog, formatter_class=RawDescriptionHelpFormatter)
     parser.add_argument('cycle',  metavar='cycle')
+    parser.add_argument('--series', action='append', default=[], metavar='series')
 
     args = parser.parse_args()