diff options
author | 2015-10-29 14:37:21 +0200 | |
---|---|---|
committer | 2015-10-29 14:37:21 +0200 | |
commit | cd64f9efd72f1502d2b1369da7f73eec15542c7c (patch) | |
tree | 869ceecf36ee4b498b3cbf6568d88ed525b11bb3 /scripts/automation/trex_control_plane/client_utils/general_utils.py | |
parent | 3978adceba8ce3861097747868da22bce379edd2 (diff) | |
parent | d78150a66de591a77df2496e5de828d3232a931a (diff) |
Merge branch 'dan_stateless' of csi-sceasr-b45:/auto/proj-pcube-b/apps/PL-b/tools/repo//trex-core into rpc_intg1
Diffstat (limited to 'scripts/automation/trex_control_plane/client_utils/general_utils.py')
-rwxr-xr-x | scripts/automation/trex_control_plane/client_utils/general_utils.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/client_utils/general_utils.py b/scripts/automation/trex_control_plane/client_utils/general_utils.py index 5488b9dd..3c025608 100755 --- a/scripts/automation/trex_control_plane/client_utils/general_utils.py +++ b/scripts/automation/trex_control_plane/client_utils/general_utils.py @@ -75,6 +75,22 @@ def random_id_gen(length=8): return_id += random.choice(id_chars) yield return_id +def id_count_gen(): + """ + A generator for creating an increasing id for objects, starting from 0 + + :parameters: + None + + :return: + an id (unsigned int) with each next() request. + """ + return_id = 0 + while True: + yield return_id + return_id += 1 + + if __name__ == "__main__": pass |