コード例 #1
0
    def snapshot(self):
        """Example:
        self.conf.target IS /target
        self.host IS host.domain.tld
        self.path IS /var/log/somedir
        self.target_path IS /target/host.domain.tld/var/log
        """
        self.get(self.path, self.target_path)

        if self.exclude:
            utils.remove(self.full_dst_path, self.exclude)
コード例 #2
0
ファイル: driver.py プロジェクト: nebril/fuel-web
    def snapshot(self):
        """Example:
        self.conf.target IS /target
        self.host IS host.domain.tld
        self.path IS /var/log/somedir
        self.target_path IS /target/host.domain.tld/var/log
        """
        self.get(self.path, self.target_path)

        if self.exclude:
            utils.remove(self.full_dst_path, self.exclude)
コード例 #3
0
 def test_remove_subdir(self, mexecute):
     utils.remove('/', ['good', '**/*.py'])
     mexecute.assert_has_calls([
         mock.call('shopt -s globstar; rm -rf /good', shell=True),
         mock.call('shopt -s globstar; rm -rf /**/*.py', shell=True)
     ])
コード例 #4
0
 def test_remove_subdir(self, mexecute):
     utils.remove('/', ['good', '**/*.py'])
     mexecute.assert_has_calls([
         mock.call('shopt -s globstar; rm -rf /good', shell=True),
         mock.call('shopt -s globstar; rm -rf /**/*.py', shell=True)])