From c35cb8d385a2267cf96f8f7a3f4c95250a63a0f7 Mon Sep 17 00:00:00 2001 From: Nick Hurley Date: Wed, 30 Jan 2013 15:29:30 -0800 Subject: [PATCH] Add appropriate defaults for netconfigs and operating systems Code expects it to be a list, make sure it's a list, not None --- srcloner.py | 4 ++-- srdeferrer.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/srcloner.py b/srcloner.py index c49d15a..18106b9 100644 --- a/srcloner.py +++ b/srcloner.py @@ -343,10 +343,10 @@ def main(): parser.add_argument('--srid', dest='srid', required=True) for ops in stoneridge.OPERATING_SYSTEMS: parser.add_argument('--%s' % (ops,), dest='operating_systems', - action='append_const', const=ops) + action='append_const', const=ops, default=[]) for nc in stoneridge.NETCONFIGS: parser.add_argument('--%s' % (nc,), dest='netconfigs', - action='append_const', const=nc) + action='append_const', const=nc, default=[]) parser.add_argument('--attempt', dest='attempt', required=True, type=int) parser.add_argument('--ldap', dest='ldap', default='') parser.add_argument('--sha', dest='sha', default='') diff --git a/srdeferrer.py b/srdeferrer.py index ec73c42..f31794b 100644 --- a/srdeferrer.py +++ b/srdeferrer.py @@ -55,10 +55,10 @@ def main(): parser.add_argument('--sha', dest='sha', default='') for nc in stoneridge.NETCONFIGS: parser.add_argument('--%s' % (nc,), dest='netconfigs', - action='append_const', const=nc) + action='append_const', const=nc, default=[]) for ops in stoneridge.OPERATING_SYSTEMS: parser.add_argument('--%s' % (nc,), dest='operating_systems', - action='append_const', const=ops) + action='append_const', const=ops, default=[]) args = parser.parse_args()