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:
Emilien Macchi 2014-10-01 13:38:02 -04:00
parent f9f1260739
commit 7576296b6c
6 changed files with 70 additions and 8 deletions

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
*~
.testrepository
*.sw?
*.pyc
.tox
*.egg-info
dist
build
AUTHORS
ChangeLog

View File

@ -1,4 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=stackforge/tripleo-puppet-elements.git
project=openstack/tripleo-puppet-elements.git

8
.testr.conf Normal file
View 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

View File

@ -18,6 +18,9 @@ set -o pipefail
flake8
extra_python_files=$(egrep -R --null-data --files-with-matches "^#!/usr/bin/env python" elements/)
echo $extra_python_files
flake8 ${extra_python_files}
# TODO (EmilienM) disable elements flake8 check, since we don't have elements yet.
# if we don't comment this, egrep will return '1' and flake8 will fail.
#
# extra_python_files=$(egrep -R --null-data --files-with-matches "^#!/usr/bin/env python" elements/)
# echo $extra_python_files
# flake8 ${extra_python_files}

View File

@ -1,12 +1,12 @@
[metadata]
name = tripleo-image-elements
summary = Disk image builder elements for deploying OpenStack.
name = tripleo-puppet-elements
summary = Puppet building rules for OpenStack images.
description-file =
README.md
author = OpenStack
author_email = openstack-dev@lists.openstack.org
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 =
Environment :: OpenStack
Development Status :: 3 - Alpha
@ -17,7 +17,7 @@ classifier =
[files]
data_files =
share/tripleo-image-elements = elements/*
share/tripleo-puppet-elements = elements/*
[wheel]
universal = 1

View 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)