Odyssey
Public Member Functions | Static Public Attributes | List of all members
cli.fixture.Load Class Reference
Inheritance diagram for cli.fixture.Load:

Public Member Functions

def setup_args (self, parser)
 
def run (self, args)
 
def load_from_dir (self, args, path)
 
def install_files (self, src, dst)
 

Static Public Attributes

string name = 'load'
 
int file_owner = 33
 
int file_group = 33
 

Detailed Description

Load a DB and/or FS fixture.

Typically fixtures are tar/gz bundles located in your project's
`/fixtures` directory.  The exact layout of these bundles is documented in
the README.md of this same directory.  In short, each fixture bundle
represents data associated with a single customer (credit union).  In the
Odyssey system credit union data consists of custom DB tables prefixed
with the credit union code, (cruisecu for example) and of customizable
filesystem assets which are typically located in /home/<cucode>/.
Initially the filesystem content is just boilerplate, but can be
customized for each customer. 

Definition at line 28 of file fixture.py.

Member Function Documentation

◆ install_files()

def cli.fixture.Load.install_files (   self,
  src,
  dst 
)
Copy the file tree into the destination location and correct
ownership as needed. 

Definition at line 113 of file fixture.py.

113  def install_files(self, src, dst):
114  """ Copy the file tree into the destination location and correct
115  ownership as needed. """
116  distutils.dir_util.copy_tree(src, dst, preserve_symlinks=1,
117  verbose=1)
118  shutil.chown(dst, self.file_owner, self.file_group)
119  for root, dirs, files in os.walk(dst):
120  for x in files + dirs:
121  shutil.chown(os.path.join(root, x), self.file_owner,
122  self.file_group)
123 
124 

The documentation for this class was generated from the following file: