-
Notifications
You must be signed in to change notification settings - Fork 289
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #14491 - adding setting to turn lazy sync off
- Loading branch information
John Mitsch
committed
Apr 12, 2016
1 parent
8b9306e
commit a6ec67e
Showing
17 changed files
with
140 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module Katello | ||
class RepositoryDownloadPolicy | ||
class << self | ||
def policies | ||
if !::Foreman.in_rake? && Setting[:enable_deferred_download_policies] | ||
::Runcible::Models::YumImporter::DOWNLOAD_POLICIES | ||
else | ||
["immediate"] | ||
end | ||
end | ||
|
||
def default | ||
if policies.include?(Setting[:default_download_policy]) | ||
Setting[:default_download_policy] | ||
else | ||
policies.first | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
engines/bastion_katello/app/assets/javascripts/bastion_katello/settings/setting.factory.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @ngdoc service | ||
* @name Bastion.settings.factory:Setting | ||
* | ||
* @requires BastionResource | ||
* | ||
* @description | ||
* Provides a BastionResource for a Setting. | ||
*/ | ||
angular.module('Bastion.settings').factory('Setting', | ||
['BastionResource', function (BastionResource) { | ||
var resource = BastionResource('/api/v2/settings/'); | ||
return resource; | ||
}] | ||
); |
12 changes: 12 additions & 0 deletions
12
engines/bastion_katello/app/assets/javascripts/bastion_katello/settings/settings.module.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* @ngdoc module | ||
* @name Bastion.settings | ||
* | ||
* @description | ||
* Module for settings | ||
*/ | ||
angular.module('Bastion.settings', [ | ||
'ngResource', | ||
'Bastion', | ||
'Bastion.common' | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 9 additions & 1 deletion
10
engines/bastion_katello/test/repositories/details/repository-details-info.controller.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
engines/bastion_katello/test/settings/setting.factory.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
describe('Factory: Setting', function () { | ||
var $httpBackend, | ||
setting; | ||
|
||
beforeEach(module('Bastion.settings', 'Bastion.test-mocks')); | ||
|
||
beforeEach(module(function ($provide) { | ||
setting = { | ||
results: [ | ||
{ value: 'true' } | ||
] | ||
}; | ||
})); | ||
|
||
beforeEach(inject(function ($injector) { | ||
$httpBackend = $injector.get('$httpBackend'); | ||
OstreeBranch = $injector.get('Setting'); | ||
})); | ||
|
||
afterEach(function () { | ||
$httpBackend.flush(); | ||
$httpBackend.verifyNoOutstandingExpectation(); | ||
$httpBackend.verifyNoOutstandingRequest(); | ||
}); | ||
|
||
it('provides a way to get a list of repositories', function () { | ||
$httpBackend.expectGET('/api/v2/settings').respond(setting); | ||
|
||
OstreeBranch.queryPaged(function (setting) { | ||
expect(setting.results.length).toBeGreaterThan(0); | ||
}); | ||
}); | ||
}); | ||
|