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)
     ])
 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)])