diff options
author | Danilo Segan <danilo@canonical.com> | 2012-02-28 10:41:59 +0100 |
---|---|---|
committer | Danilo Segan <danilo@canonical.com> | 2012-02-28 10:41:59 +0100 |
commit | b397ab606edb2f130a2e5ad0986da2948c4a1407 (patch) | |
tree | c3c385b0eddf99eb9419a39eeed365e68c6aa793 /scripts | |
parent | 76ba254e614b5a4a785ea613284d32eaeafa9e34 (diff) |
Process invalid/valid parameters to the run method.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/publish_to_snapshots.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/scripts/publish_to_snapshots.py b/scripts/publish_to_snapshots.py index 5794c55..08a62ff 100644 --- a/scripts/publish_to_snapshots.py +++ b/scripts/publish_to_snapshots.py @@ -1,7 +1,22 @@ #!/usr/bin/env python -class SnapshotsPublisher(object): +import optparse + + +class InvalidParametersException(Exception): pass +acceptable_job_types = [ + 'android', + 'kernel-hwpack', + ] + +class SnapshotsPublisher(object): + def run(self, arguments): + if (arguments is None or len(arguments) < 3 or + arguments[0] not in acceptable_job_types): + raise InvalidParametersException + + if __name__ == '__main__': pass |