Skip to content

Commit

Permalink
PEP-8 client_consumer/.
Browse files Browse the repository at this point in the history
  • Loading branch information
Randy Barlow committed May 20, 2015
1 parent fc77246 commit 37692b5
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 82 deletions.
14 changes: 0 additions & 14 deletions client_consumer/pulp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
# -*- coding: utf-8 -*-
#
# Copyright © 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the implied warranties of MERCHANTABILITY,
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
# have received a copy of GPLv2 along with this software; if not, see
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.

from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)

95 changes: 30 additions & 65 deletions client_consumer/pulp/client/consumer/config.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
# Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the implied warranties of MERCHANTABILITY,
# NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
# have received a copy of GPLv2 along with this software; if not, see
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.

import os
import socket

from pulp.common.config import Config, REQUIRED, ANY, NUMBER, BOOL, OPTIONAL


DEFAULT = {
'server': {
'host': socket.gethostname(),
Expand Down Expand Up @@ -65,67 +55,42 @@

SCHEMA = (
('server', REQUIRED,
(
('host', REQUIRED, ANY),
('port', REQUIRED, NUMBER),
('api_prefix', REQUIRED, ANY),
('verify_ssl', REQUIRED, BOOL),
('ca_path', REQUIRED, ANY),
('rsa_pub', REQUIRED, ANY),
)
),
(('host', REQUIRED, ANY),
('port', REQUIRED, NUMBER),
('api_prefix', REQUIRED, ANY),
('verify_ssl', REQUIRED, BOOL),
('ca_path', REQUIRED, ANY),
('rsa_pub', REQUIRED, ANY))),
('authentication', REQUIRED,
(
('rsa_key', REQUIRED, ANY),
('rsa_pub', REQUIRED, ANY),
)
),
(('rsa_key', REQUIRED, ANY),
('rsa_pub', REQUIRED, ANY))),
('client', REQUIRED,
(
('role', REQUIRED, r'consumer'),
)
),
(('role', REQUIRED, r'consumer'),),),
('filesystem', REQUIRED,
(
('extensions_dir', REQUIRED, ANY),
('repo_file', REQUIRED, ANY),
('mirror_list_dir', REQUIRED, ANY),
('gpg_keys_dir', REQUIRED, ANY),
('cert_dir', REQUIRED, ANY),
('id_cert_dir', REQUIRED, ANY),
('id_cert_filename', REQUIRED, ANY),
)
),
(('extensions_dir', REQUIRED, ANY),
('repo_file', REQUIRED, ANY),
('mirror_list_dir', REQUIRED, ANY),
('gpg_keys_dir', REQUIRED, ANY),
('cert_dir', REQUIRED, ANY),
('id_cert_dir', REQUIRED, ANY),
('id_cert_filename', REQUIRED, ANY))),
('reboot', REQUIRED,
(
('permit', REQUIRED, BOOL),
('delay', REQUIRED, NUMBER),
)
),
(('permit', REQUIRED, BOOL),
('delay', REQUIRED, NUMBER))),
('output', REQUIRED,
(
('poll_frequency_in_seconds', REQUIRED, NUMBER),
('enable_color', REQUIRED, BOOL),
('wrap_to_terminal', REQUIRED, BOOL),
('wrap_width', REQUIRED, NUMBER)
)
),
(('poll_frequency_in_seconds', REQUIRED, NUMBER),
('enable_color', REQUIRED, BOOL),
('wrap_to_terminal', REQUIRED, BOOL),
('wrap_width', REQUIRED, NUMBER))),
('messaging', REQUIRED,
(
('scheme', REQUIRED, r'(tcp|ssl|amqp|amqps)'),
('host', OPTIONAL, ANY),
('port', REQUIRED, NUMBER),
('transport', REQUIRED, ANY),
('cacert', OPTIONAL, ANY),
('clientcert', OPTIONAL, ANY)
)
),
(('scheme', REQUIRED, r'(tcp|ssl|amqp|amqps)'),
('host', OPTIONAL, ANY),
('port', REQUIRED, NUMBER),
('transport', REQUIRED, ANY),
('cacert', OPTIONAL, ANY),
('clientcert', OPTIONAL, ANY))),
('profile', REQUIRED,
(
('minutes', REQUIRED, NUMBER),
)
),
)
(('minutes', REQUIRED, NUMBER),)))


def read_config(paths=None, validate=True):
Expand Down
2 changes: 0 additions & 2 deletions client_consumer/test/unit/test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from unittest import TestCase

from mock import patch, Mock
Expand Down Expand Up @@ -38,7 +37,6 @@ def test_default(self):
msg = '[%s].%s has default but not found in the schema' % (section, key)
self.assertTrue(self.schema_has_property(section, key), msg=msg)


@patch('os.listdir')
@patch('os.path.expanduser')
@patch('os.path.exists', Mock(return_value=False))
Expand Down
2 changes: 1 addition & 1 deletion run-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
paths_to_check = [
'agent',
'bindings',
'client_consumer/pulp/client/consumer/cli.py',
'client_consumer',
'client_lib',
'repoauth/',
'server/pulp/plugins',
Expand Down

0 comments on commit 37692b5

Please sign in to comment.