diff options
author | Jack Lucas <jflucas@research.att.com> | 2017-09-01 13:48:08 +0000 |
---|---|---|
committer | Jack Lucas <jflucas@research.att.com> | 2017-09-01 13:50:18 +0000 |
commit | 0619cb3772a12e0a5a3aecc09b96eeb7df20a000 (patch) | |
tree | b8a921e0e41578163f7c2db41450301c374361df /dmaap/dmaapplugin/dmaaputils.py | |
parent | ac3f029edc6bc8b25ab44666b5408c8929e6ba92 (diff) |
Add seed code for DMaaP plugin
Change-Id: I8c7a9c432badd3052a571ed87b9b580760b376e6
Issue-Id: CCSDK-65
Signed-off-by: Jack Lucas <jflucas@research.att.com>
Diffstat (limited to 'dmaap/dmaapplugin/dmaaputils.py')
-rw-r--r-- | dmaap/dmaapplugin/dmaaputils.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/dmaap/dmaapplugin/dmaaputils.py b/dmaap/dmaapplugin/dmaaputils.py new file mode 100644 index 0000000..e043a07 --- /dev/null +++ b/dmaap/dmaapplugin/dmaaputils.py @@ -0,0 +1,28 @@ +# ============LICENSE_START==================================================== +# org.onap.ccsdk +# ============================================================================= +# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. +# ============================================================================= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END====================================================== + +# Utility functions + +import string +import random + +def random_string(n): + ''' + Create a random alphanumeric string, n characters long. + ''' + return ''.join(random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for x in range(n)) |