more cleaning
This commit is contained in:
parent
8469db41eb
commit
7d795d23ef
@ -14,8 +14,6 @@
|
||||
# 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 sys
|
||||
import argparse
|
||||
from textwrap import dedent
|
||||
@ -138,6 +136,7 @@ def start(args):
|
||||
db.commit()
|
||||
'''
|
||||
|
||||
|
||||
def status(args):
|
||||
"""get the status of a running test
|
||||
|
||||
@ -323,6 +322,7 @@ def subcommands(subparsers):
|
||||
dest='cloud_id',
|
||||
help='The id of the cloud you want a config for')
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
@ -364,6 +364,5 @@ def main():
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@ -1,15 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2013 Piston Cloud Computing, Inc.
|
||||
# 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.
|
@ -1,69 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2013 Piston Cloud Computing, Inc.
|
||||
# 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.
|
||||
from keystoneclient.v2_0 import client
|
||||
from refstack.common import *
|
||||
import refstack.models
|
||||
|
||||
class Clouds
|
||||
|
||||
class Cloud(object):
|
||||
""" Cloud functions"""
|
||||
cloud_id = None
|
||||
|
||||
def __init__(self, cloud_id = None):
|
||||
""" init method loads specified id or fails"""
|
||||
self.cloud_id = cloud_id
|
||||
|
||||
if not cloud_id:
|
||||
# we have a new cloud.
|
||||
# do nothing because now we'll call the add method
|
||||
return None
|
||||
else:
|
||||
# load an existing cloud
|
||||
self._cloud = models.Cloud.query.filter_by(id=self.cloud_id).first()
|
||||
|
||||
if not self._cloud:
|
||||
# cloud not found.. invalid id
|
||||
# maybe I should do someting about this ..
|
||||
return None
|
||||
|
||||
self._keystone = client.Client(username=self._cloud.admin_user,
|
||||
password=self._cloud.admin_key,
|
||||
auth_url=self._cloud.admin_endpoint )
|
||||
|
||||
self._end_point = None
|
||||
|
||||
def add(self,endpoint,test_user,test_key,
|
||||
admin_endpoint,admin_user,admin_key,vendor_id=None):
|
||||
#adds a new cloud to the db
|
||||
models.db.session.add(Cloud(endpoint,test_user,test_key,
|
||||
admin_endpoint,admin_user,admin_key,vendor_id))
|
||||
models.db.session.commit()
|
||||
|
||||
@property
|
||||
def end_point(self):
|
||||
"""end_point property"""
|
||||
return self._end_point
|
||||
|
||||
@end_point.setter
|
||||
def end_point(self, value):
|
||||
self._end_point = value
|
||||
|
||||
def get_config(self):
|
||||
"""uses end_point and creditials from the specified cloud_id to
|
||||
get a list of services and enpoints from keystone then outputs a
|
||||
usable tempest config"""
|
||||
|
@ -17,7 +17,6 @@ from keystoneclient.v2_0 import client
|
||||
from refstack.models import *
|
||||
|
||||
|
||||
|
||||
class TempestConfig(object):
|
||||
"""temptest config options. gets converted to a tempest config file"""
|
||||
config = {}
|
||||
@ -45,7 +44,6 @@ class TempestConfig(object):
|
||||
# maybe I should do someting about this ..
|
||||
return None
|
||||
|
||||
|
||||
# This stuff we know before hitting up keystone
|
||||
self.config['identity']['uri'] = self._cloud.admin_endpoint
|
||||
self.config['identity']['admin_username'] = self._cloud.admin_user
|
||||
@ -95,7 +93,6 @@ class TempestConfig(object):
|
||||
return self.output()
|
||||
|
||||
|
||||
|
||||
def __init__(self, cloud_id):
|
||||
""" sets up the default configs"""
|
||||
self.cloud_id = cloud_id
|
||||
|
@ -14,11 +14,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import os
|
||||
import sys
|
||||
import errno
|
||||
from subprocess import call
|
||||
from textwrap import dedent
|
||||
from refstack.app import app
|
||||
from refstack.common.tempest_config import TempestConfig
|
||||
import testrepository.repository.file
|
||||
from testrepository import ui
|
||||
@ -27,6 +23,7 @@ from testrepository.commands import init
|
||||
|
||||
import gear
|
||||
|
||||
|
||||
class TesterWorker(object):
|
||||
"""gearman worker code"""
|
||||
def __init__(self,app):
|
||||
@ -46,7 +43,6 @@ class TesterWorker(object):
|
||||
job.sendWorkComplete(job.arguments.reverse())
|
||||
|
||||
|
||||
|
||||
class TestRepositoryUI(ui.AbstractUI):
|
||||
"""nothing"""
|
||||
def __init__(self, here):
|
||||
@ -57,7 +53,6 @@ class TestRepositoryUI(ui.AbstractUI):
|
||||
self.here = here
|
||||
|
||||
|
||||
|
||||
class TestRepositorySource(object):
|
||||
"""Get test results from a testrepository.
|
||||
|
||||
@ -111,7 +106,6 @@ class TestRepositorySource(object):
|
||||
return repo.get_test_run(repo.latest_id()).get_subunit_stream()
|
||||
|
||||
|
||||
|
||||
class Tester(object):
|
||||
""" Test functions"""
|
||||
test_id = None
|
||||
@ -141,7 +135,6 @@ class Tester(object):
|
||||
# start tests against cloud_id using sha of tempest
|
||||
# no sha indicates trunk
|
||||
|
||||
|
||||
def run_local(self):
|
||||
"""triggers local run"""
|
||||
# make sure we have a folder to put a repo in..
|
||||
@ -208,12 +201,9 @@ group_regex=([^\.]*\.)*"""
|
||||
with open(path+".testr.conf", "w") as testr_config_file:
|
||||
testr_config_file.write(testr_output)
|
||||
|
||||
|
||||
|
||||
def cancel(self):
|
||||
""" cancels a running test"""
|
||||
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
"""The status property."""
|
||||
@ -225,7 +215,6 @@ group_regex=([^\.]*\.)*"""
|
||||
del self._status
|
||||
return locals()
|
||||
|
||||
|
||||
@property
|
||||
def config(self):
|
||||
"""The config property. outputs a tempest config based on settings"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user