neutron-lbaas/neutron_lbaas/tests/tools.py
Ihar Hrachyshka d3386d3e97 Uncouple lbaas object models from neutron core plugin results
Since I6e1ef53d7aae7d04a5485810cc1db0a8eb125953, subnets have
'description' field. We should accommodate for it on lbaas side.

Instead of introducing yet another field for lbaas object, make base
class filter out unknown fields in from_dict() before passing them into
__init__.

Change-Id: Ib00f61cfbc13bf934c31eb476039728830e79e92
Closes-Bug: #1554076
2016-03-08 16:19:36 +01:00

21 lines
745 B
Python

# 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.
import random
import string
# NOTE(ihrachys): this function is copied from neutron tree
def get_random_string(n=10):
return ''.join(random.choice(string.ascii_lowercase) for _ in range(n))