Browse Source

Do not subclass object

bugfix/make-code-consistent
Dennis Camera 2 years ago
parent
commit
ce07021580
  1. 2
      cdist/config.py
  2. 2
      cdist/core/cdist_object.py
  3. 2
      cdist/core/cdist_type.py
  4. 2
      cdist/core/code.py
  5. 2
      cdist/core/explorer.py
  6. 2
      cdist/core/manifest.py
  7. 2
      cdist/emulator.py
  8. 2
      cdist/exec/local.py
  9. 2
      cdist/exec/remote.py
  10. 2
      cdist/hostsource.py
  11. 3
      cdist/info.py
  12. 2
      cdist/inventory.py
  13. 2
      cdist/message.py
  14. 2
      cdist/preos.py
  15. 2
      cdist/preos/debootstrap/debootstrap.py
  16. 4
      cdist/shell.py
  17. 2
      cdist/test/config/__init__.py
  18. 4
      cdist/util/fsproperty.py

2
cdist/config.py vendored

@ -70,7 +70,7 @@ def _graph_dfs_cycle(graph, node, path):
return False
class Config(object):
class Config:
"""Cdist main class to hold arbitrary data"""
# list of paths (files and/or directories) that will be removed on finish

2
cdist/core/cdist_object.py vendored

@ -47,7 +47,7 @@ class MissingObjectIdError(cdist.Error):
return '%s' % (self.message)
class CdistObject(object):
class CdistObject:
"""Represents a cdist object.
All interaction with objects in cdist should be done through this class.

2
cdist/core/cdist_type.py vendored

@ -38,7 +38,7 @@ class InvalidTypeError(cdist.Error):
self.type_path, self.type_absolute_path, self.source_path)
class CdistType(object):
class CdistType:
"""Represents a cdist type.
All interaction with types in cdist should be done through this class.

2
cdist/core/code.py vendored

@ -92,7 +92,7 @@ code-remote
'''
class Code(object):
class Code:
"""Generates and executes cdist code scripts.
"""

2
cdist/core/explorer.py vendored

@ -63,7 +63,7 @@ type explorer is:
'''
class Explorer(object):
class Explorer:
"""Executes cdist explorers.
"""

2
cdist/core/manifest.py vendored

@ -92,7 +92,7 @@ class NoInitialManifestError(cdist.Error):
return repr(self.message)
class Manifest(object):
class Manifest:
"""Executes cdist manifests.
"""

2
cdist/emulator.py vendored

@ -56,7 +56,7 @@ class DefaultList(list):
return cls(initial.split('\n'))
class Emulator(object):
class Emulator:
def __init__(self, argv, stdin=sys.stdin.buffer, env=os.environ):
self.argv = argv
self.stdin = stdin

2
cdist/exec/local.py vendored

@ -39,7 +39,7 @@ import cdist.exec.util as util
CONF_SUBDIRS_LINKED = ["explorer", "files", "manifest", "type", ]
class Local(object):
class Local:
"""Execute commands locally.
All interaction with the local side should be done through this class.

2
cdist/exec/remote.py vendored

@ -49,7 +49,7 @@ class DecodeError(cdist.Error):
return "Cannot decode output of " + " ".join(self.command)
class Remote(object):
class Remote:
"""Execute commands remotely.
All interaction with the remote side should be done through this class.

2
cdist/hostsource.py vendored

@ -41,7 +41,7 @@ def hostfile_process_line(line, strip_func=str.strip):
return None
class HostSource(object):
class HostSource:
"""
Host source object.
Source can be a sequence or filename (stdin if \'-\').

3
cdist/info.py vendored

@ -29,8 +29,7 @@ import glob
import fnmatch
class Info(object):
class Info:
def __init__(self, conf_dirs, args):
self.conf_dirs = conf_dirs
self.all = args.all

2
cdist/inventory.py vendored

@ -80,7 +80,7 @@ def rstrip_nl(s):
return str.rstrip(s, "\n")
class Inventory(object):
class Inventory:
"""Inventory main class"""
def __init__(self, db_basedir=dist_inventory_db, configuration=None):

2
cdist/message.py vendored

@ -27,7 +27,7 @@ import tempfile
log = logging.getLogger(__name__)
class Message(object):
class Message:
"""Support messaging between types
"""

2
cdist/preos.py vendored

@ -78,7 +78,7 @@ def get_available_preoses_string(cls):
return "Available PreOS-es:\n{}".format("\n".join(preoses))
class PreOS(object):
class PreOS:
preoses = None
@classmethod

2
cdist/preos/debootstrap/debootstrap.py vendored

@ -31,7 +31,7 @@ import os
import subprocess
class Debian(object):
class Debian:
_preos_name = 'debian'
_cdist_preos = True

4
cdist/shell.py vendored

@ -32,10 +32,8 @@ import cdist.config
log = logging.getLogger(__name__)
class Shell(object):
class Shell:
def __init__(self, shell=None):
self.shell = shell
self.target_host = (

2
cdist/test/config/__init__.py vendored

@ -44,7 +44,7 @@ expected_object_names = sorted([
'__third/moon'])
class CdistObjectErrorContext(object):
class CdistObjectErrorContext:
def __init__(self, original_error):
self.original_error = original_error

4
cdist/util/fsproperty.py vendored

@ -177,7 +177,7 @@ class DirectoryDict(collections.MutableMapping):
raise cdist.Error(str(e))
class FileBasedProperty(object):
class FileBasedProperty:
attribute_class = None
def __init__(self, path):
@ -189,7 +189,7 @@ class FileBasedProperty(object):
Usage with a sublcass:
class Foo(object):
class Foo:
# note that the actual DirectoryDict is stored as __parameters
# on the instance
parameters = DirectoryDictProperty(

Loading…
Cancel
Save