Update repository after OpenStack migration
* Add .gitignore * Update .gitreview (we thought it would be on Stackforge, but finally it's on OpenStack) * Add .testr.conf * Update run-flake8 script to avoid error when running flake8 without elements. * Update setup.cfg with correct name & description * Add no_dup_filenames unit test (required to have py27 gate working) Change-Id: Iea79eb5ccaa5ea765730ca99e146e54a3c0812f9
This commit is contained in:
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
*~
|
||||||
|
.testrepository
|
||||||
|
*.sw?
|
||||||
|
*.pyc
|
||||||
|
.tox
|
||||||
|
*.egg-info
|
||||||
|
dist
|
||||||
|
build
|
||||||
|
AUTHORS
|
||||||
|
ChangeLog
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[gerrit]
|
[gerrit]
|
||||||
host=review.openstack.org
|
host=review.openstack.org
|
||||||
port=29418
|
port=29418
|
||||||
project=stackforge/tripleo-puppet-elements.git
|
project=openstack/tripleo-puppet-elements.git
|
||||||
|
|||||||
8
.testr.conf
Normal file
8
.testr.conf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||||
|
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||||
|
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-160} \
|
||||||
|
${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION
|
||||||
|
|
||||||
|
test_id_option=--load-list $IDFILE
|
||||||
|
test_list_option=--list
|
||||||
@@ -18,6 +18,9 @@ set -o pipefail
|
|||||||
|
|
||||||
flake8
|
flake8
|
||||||
|
|
||||||
extra_python_files=$(egrep -R --null-data --files-with-matches "^#!/usr/bin/env python" elements/)
|
# TODO (EmilienM) disable elements flake8 check, since we don't have elements yet.
|
||||||
echo $extra_python_files
|
# if we don't comment this, egrep will return '1' and flake8 will fail.
|
||||||
flake8 ${extra_python_files}
|
#
|
||||||
|
# extra_python_files=$(egrep -R --null-data --files-with-matches "^#!/usr/bin/env python" elements/)
|
||||||
|
# echo $extra_python_files
|
||||||
|
# flake8 ${extra_python_files}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = tripleo-image-elements
|
name = tripleo-puppet-elements
|
||||||
summary = Disk image builder elements for deploying OpenStack.
|
summary = Puppet building rules for OpenStack images.
|
||||||
description-file =
|
description-file =
|
||||||
README.md
|
README.md
|
||||||
author = OpenStack
|
author = OpenStack
|
||||||
author_email = openstack-dev@lists.openstack.org
|
author_email = openstack-dev@lists.openstack.org
|
||||||
license = Apache License (2.0)
|
license = Apache License (2.0)
|
||||||
home-page = https://git.openstack.org/cgit/openstack/tripleo-image-elements
|
home-page = https://git.openstack.org/cgit/openstack/tripleo-puppet-elements
|
||||||
classifier =
|
classifier =
|
||||||
Environment :: OpenStack
|
Environment :: OpenStack
|
||||||
Development Status :: 3 - Alpha
|
Development Status :: 3 - Alpha
|
||||||
@@ -17,7 +17,7 @@ classifier =
|
|||||||
|
|
||||||
[files]
|
[files]
|
||||||
data_files =
|
data_files =
|
||||||
share/tripleo-image-elements = elements/*
|
share/tripleo-puppet-elements = elements/*
|
||||||
|
|
||||||
[wheel]
|
[wheel]
|
||||||
universal = 1
|
universal = 1
|
||||||
|
|||||||
41
tests/test_no_dup_filenames.py
Normal file
41
tests/test_no_dup_filenames.py
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# Copyright 2014 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# 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 glob
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
import testtools
|
||||||
|
|
||||||
|
|
||||||
|
class TestNoDupFilenames(testtools.TestCase):
|
||||||
|
|
||||||
|
def test_no_dup_filenames(self):
|
||||||
|
topdir = os.path.normpath(os.path.dirname(__file__) + '/../')
|
||||||
|
elements_glob = os.path.join(topdir, "elements", "*")
|
||||||
|
|
||||||
|
filenames = []
|
||||||
|
dirs_to_check = ['block-device.d', 'cleanup.d', 'extra-data.d',
|
||||||
|
'finalise.d', 'install.d', 'post-install.d',
|
||||||
|
'pre-install.d', 'root.d']
|
||||||
|
|
||||||
|
for element_dir in glob.iglob(elements_glob):
|
||||||
|
for dir_to_check in dirs_to_check:
|
||||||
|
target_dir = os.path.join(element_dir, dir_to_check, "*")
|
||||||
|
for target in glob.iglob(target_dir):
|
||||||
|
short_path = target[len(element_dir) + 1:]
|
||||||
|
if not os.path.isdir(target):
|
||||||
|
err_msg = 'Duplicate file name found %s' % short_path
|
||||||
|
self.assertFalse(short_path in filenames, err_msg)
|
||||||
|
filenames.append(short_path)
|
||||||
Reference in New Issue
Block a user