Beispiel #1
0
 def test_dir_already_exists(self):
     destination = os.path.join(self.tmp_dir, 'puppet')
     os.makedirs(destination)
     distributor = installdistributor.PuppetModuleInstallDistributor()
     destination_dir = distributor._create_temporary_destination_directory(destination)
     self.assertTrue(os.path.isdir(destination_dir))
     self.assertTrue(os.path.isdir(destination))
Beispiel #2
0
 def setUp(self):
     self.distributor = installdistributor.PuppetModuleInstallDistributor()
     self.uk1 = {'author': 'puppetlabs', 'name': 'stdlib', 'version': '1.2.0'}
     self.uk2 = {'author': 'puppetlabs', 'name': 'stdlib', 'version': '1.2.1'}
     self.units = [
         Module(_storage_path='/a/b/x', **self.uk1),
         Module(_storage_path='/a/b/y', **self.uk2)
     ]
Beispiel #3
0
 def setUp(self):
     self.distributor = installdistributor.PuppetModuleInstallDistributor()
     self.puppet_dir = '/opt/my/modules/'
     self.repo = Repository('repo1', '', repo_obj=mock.MagicMock())
     self.conduit = RepoPublishConduit('repo1', self.distributor.metadata()['id'])
     self.uk1 = {'author': 'puppetlabs', 'name': 'stdlib', 'version': '1.2.0'}
     self.uk2 = {'author': 'puppetlabs', 'name': 'java', 'version': '1.3.1'}
     self.units = [
         Module(_storage_path='/a/b/x', **self.uk1),
         Module(_storage_path='/a/b/y', **self.uk2)
     ]
     self.conduit.get_units = mock.MagicMock(return_value=self.units, spec_set=self.conduit.get_units)
Beispiel #4
0
 def setUp(self):
     self.distributor = installdistributor.PuppetModuleInstallDistributor()
     self.uk1 = {
         'author': 'puppetlabs',
         'name': 'stdlib',
         'version': '1.2.0'
     }
     self.uk2 = {
         'author': 'puppetlabs',
         'name': 'stdlib',
         'version': '1.2.1'
     }
     self.units = [
         AssociatedUnit(constants.TYPE_PUPPET_MODULE, self.uk1, {},
                        '/a/b/x', '', '', '', ''),
         AssociatedUnit(constants.TYPE_PUPPET_MODULE, self.uk2, {},
                        '/a/b/y', '', '', '', ''),
     ]
Beispiel #5
0
 def setUp(self):
     self.distributor = installdistributor.PuppetModuleInstallDistributor()
     self.repo = Repository('repo1', '', {})
     self.conduit = RepoPublishConduit('repo1',
                                       self.distributor.metadata()['id'])
     self.uk1 = {
         'author': 'puppetlabs',
         'name': 'stdlib',
         'version': '1.2.0'
     }
     self.uk2 = {'author': 'puppetlabs', 'name': 'java', 'version': '1.3.1'}
     self.units = [
         AssociatedUnit(constants.TYPE_PUPPET_MODULE, self.uk1, {},
                        '/a/b/x', '', '', '', ''),
         AssociatedUnit(constants.TYPE_PUPPET_MODULE, self.uk2, {},
                        '/a/b/y', '', '', '', ''),
     ]
     self.conduit.get_units = mock.MagicMock(
         return_value=self.units, spec_set=self.conduit.get_units)
 def setUp(self):
     self.distributor = installdistributor.PuppetModuleInstallDistributor()
     self.repo = Repository('repo1', '', {})
 def setUp(self):
     self.distributor = installdistributor.PuppetModuleInstallDistributor()
     self.repo = Repository('repo1', '', '')
     self.path = '/a/b/c/'
     self.config = PluginCallConfiguration(
         {}, {constants.CONFIG_INSTALL_PATH: self.path})
 def test_dir_permission_denied(self, *unused):
     destination = os.path.join(self.tmp_dir, 'puppet')
     distributor = installdistributor.PuppetModuleInstallDistributor()
     self.assertRaises(OSError,
                       distributor._create_temporary_destination_directory,
                       destination)
 def setUp(self):
     self.distributor = installdistributor.PuppetModuleInstallDistributor()