
This reverts commit 4076dce887b84ab4298c54eb422a069e006e590b. Commit above is the cause for UTF errors such as: [root@undercloud-0 ~]# /usr/libexec/openstack-monitoring/checks/oschecks-check_amqp neutron-server Traceback (most recent call last): File "/usr/libexec/openstack-monitoring/checks/oschecks-check_amqp", line 6, in <module> from oschecks.amqp import main File "/usr/lib/python2.7/site-packages/oschecks/amqp.py", line 23, in <module> from oschecks import utils File "/usr/lib/python2.7/site-packages/oschecks/utils.py", line 5 SyntaxError: Non-ASCII character '\xc2' in file /usr/lib/python2.7/site-packages/oschecks/utils.py on line 5, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details Change-Id: I94faa925bb642621bc8688addca60168889e93d3
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
# -*- coding: utf-8 -*-
|
|
#
|
|
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
|
|
#
|
|
# Author: Julien Danjou <julien@danjou.info>
|
|
#
|
|
# 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 subprocess
|
|
import unittest
|
|
|
|
|
|
class TestScripts(unittest.TestCase):
|
|
SCRIPTS = [
|
|
'amqp',
|
|
'ceilometer_api',
|
|
'ceph_df',
|
|
'ceph_health',
|
|
'cinder_api',
|
|
'cinder_volume',
|
|
'glance_api',
|
|
'glance_image_exists',
|
|
'glance_upload',
|
|
'keystone_api',
|
|
'neutron_api',
|
|
'neutron_floating_ip',
|
|
'nova_api',
|
|
'nova_instance',
|
|
]
|
|
|
|
|
|
for script in TestScripts.SCRIPTS:
|
|
def test_check_script(self):
|
|
proc = subprocess.Popen("oschecks-check_" + script)
|
|
proc.wait()
|
|
self.assertEqual(2, proc.returncode)
|
|
setattr(TestScripts, "test_script_check_" + script, test_check_script)
|