IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40898


Ignore:
Timestamp:
Oct 3, 2019, 12:46:09 PM (7 years ago)
Author:
fairlamb
Message:

separated out erros into it's own class and moved files to be under one module...not sure if history saved

Location:
branches/ipp-132_automate_jira_conf_backups/backups
Files:
11 added
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications.py

    r40897 r40898  
    99import sys
    1010
    11 # note that this replies on sym link to the 'trunk/tools/utils/python' folder existing
    12 # in this directory with the name 'utils'. This is not an elegant solution, but
    13 # a restructure would be needed
    14 # Ideally, the utils should be added to the path.
    15 import subprocess_utils as sub_utils
    16 
     11import backups.utils.subprocess_utils as sub_utils
     12from backups.utils.errors import ConfigError, SubprocessError
    1713
    1814DEFAULT_CONFIG_FILE = path.join(path.dirname(__file__), 'atlassian_backups.config')
    19 
    20 
    21 class ConfigError(Exception):
    22     """Error in loading the config file"""
    23 
    24     def __init__(self, config_item, message):
    25         self.config_item = config_item
    26         self.message = message
    2715
    2816
     
    284272            decoded_stderr = stde.decode()
    285273            if decoded_stderr.casefold().find('error'.casefold()) > -1:
    286                 raise sub_utils.SubprocessError()
     274                raise SubprocessError()
    287275
    288276        # move the dump file to the correct locations
  • branches/ipp-132_automate_jira_conf_backups/backups/backup_atlassian_applications_test.py

    r40897 r40898  
    1 import backup_atlassian_applications as baa
     1import backups.backup_atlassian_applications as baa
    22import configparser
    33import datetime
     
    77from pathlib import Path
    88
    9 import full_atlassian_backup_test as fab_test
    10 import subprocess_utils as sub_utils
    11 
    12 from backup_atlassian_applications import AtlassianBackups
     9import backups.full_atlassian_backup_test as fab_test
     10import backups.utils.subprocess_utils as sub_utils
     11
     12from backups.backup_atlassian_applications import AtlassianBackups
    1313
    1414TEST_DEFAULT_CONFIG_FILE = os.path.join(os.path.dirname(__file__), './testing/test.config')
Note: See TracChangeset for help on using the changeset viewer.