traffic replay: allow --random-seed=0
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Fri, 5 Oct 2018 01:42:27 +0000 (14:42 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Tue, 8 Jan 2019 22:55:31 +0000 (23:55 +0100)
Zero is a valid seed.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
script/traffic_replay

index 124136e949543bfce28622937af0cd14bd963b93..5adeec101de0e4a947b65e3d00767831653c78eb 100755 (executable)
@@ -71,7 +71,7 @@ def main():
     parser.add_option('-c', '--clean-up',
                       action="store_true",
                       help='Clean up the generated groups and user accounts')
-    parser.add_option('--random-seed', type='int', default=0,
+    parser.add_option('--random-seed', type='int', default=None,
                       help='Use to keep randomness consistent across multiple runs')
 
     model_group = optparse.OptionGroup(parser, 'Traffic Model Options',
@@ -173,7 +173,7 @@ def main():
                       " for the users created as part of this test"))
         sys.exit(1)
 
-    if opts.random_seed:
+    if opts.random_seed is not None:
         random.seed(opts.random_seed)
 
     creds = credopts.get_credentials(lp)