Exemplo n.º 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)
Exemplo n.º 2
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)
Exemplo n.º 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)])