From 0619cb3772a12e0a5a3aecc09b96eeb7df20a000 Mon Sep 17 00:00:00 2001 From: Jack Lucas Date: Fri, 1 Sep 2017 13:48:08 +0000 Subject: Add seed code for DMaaP plugin Change-Id: I8c7a9c432badd3052a571ed87b9b580760b376e6 Issue-Id: CCSDK-65 Signed-off-by: Jack Lucas --- dmaap/dmaapplugin/dmaaputils.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 dmaap/dmaapplugin/dmaaputils.py (limited to 'dmaap/dmaapplugin/dmaaputils.py') 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)) -- cgit 1.2.3-korg