foreman_bootdisk 18.1.0 → 19.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/foreman_bootdisk/disks_controller.rb +49 -2
- data/config/routes.rb +1 -0
- data/db/migrate/20140522185700_change_templatekind_to_bootdisk.rb +6 -7
- data/lib/foreman_bootdisk/engine.rb +4 -2
- data/lib/foreman_bootdisk/version.rb +1 -1
- data/locale/ca/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/ca/foreman_bootdisk.edit.po +393 -0
- data/locale/ca/foreman_bootdisk.po +7 -1
- data/locale/ca/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/de/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/de/foreman_bootdisk.edit.po +398 -0
- data/locale/de/foreman_bootdisk.po +7 -1
- data/locale/de/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/en/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/en/foreman_bootdisk.edit.po +388 -0
- data/locale/en/foreman_bootdisk.po +7 -1
- data/locale/en/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/en_GB/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/en_GB/foreman_bootdisk.edit.po +394 -0
- data/locale/en_GB/foreman_bootdisk.po +7 -1
- data/locale/en_GB/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/es/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/es/foreman_bootdisk.edit.po +394 -0
- data/locale/es/foreman_bootdisk.po +7 -1
- data/locale/es/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/foreman_bootdisk.pot +27 -14
- data/locale/fr/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/fr/foreman_bootdisk.edit.po +394 -0
- data/locale/fr/foreman_bootdisk.po +7 -1
- data/locale/fr/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/it/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/it/foreman_bootdisk.edit.po +391 -0
- data/locale/it/foreman_bootdisk.po +7 -1
- data/locale/it/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/ja/foreman_bootdisk.edit.po +393 -0
- data/locale/ja/foreman_bootdisk.po +12 -6
- data/locale/ja/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/ko/foreman_bootdisk.edit.po +390 -0
- data/locale/ko/foreman_bootdisk.po +7 -1
- data/locale/ko/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/pt_BR/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/pt_BR/foreman_bootdisk.edit.po +394 -0
- data/locale/pt_BR/foreman_bootdisk.po +7 -1
- data/locale/pt_BR/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/ru/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/ru/foreman_bootdisk.edit.po +395 -0
- data/locale/ru/foreman_bootdisk.po +7 -1
- data/locale/ru/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/sv_SE/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/sv_SE/foreman_bootdisk.edit.po +392 -0
- data/locale/sv_SE/foreman_bootdisk.po +7 -1
- data/locale/sv_SE/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/zh_CN/foreman_bootdisk.edit.po +391 -0
- data/locale/zh_CN/foreman_bootdisk.po +12 -6
- data/locale/zh_CN/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/zh_TW/LC_MESSAGES/foreman_bootdisk.mo +0 -0
- data/locale/zh_TW/foreman_bootdisk.edit.po +391 -0
- data/locale/zh_TW/foreman_bootdisk.po +7 -1
- data/locale/zh_TW/foreman_bootdisk.po.time_stamp +0 -0
- data/package.json +42 -0
- data/webpack/__mocks__/foremanReact/common/HOC.js +30 -0
- data/webpack/__mocks__/foremanReact/common/I18n.js +7 -0
- data/webpack/__mocks__/foremanReact/common/helpers.js +7 -0
- data/webpack/__mocks__/foremanReact/common/urlHelpers.js +8 -0
- data/webpack/__mocks__/foremanReact/constants.js +24 -0
- data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +6 -0
- data/webpack/__mocks__/foremanReact/redux/API/index.js +10 -0
- data/webpack/global_index.js +12 -0
- data/webpack/global_test_setup.js +11 -0
- data/webpack/index.js +0 -0
- data/webpack/src/extensions/constants.js +2 -0
- data/webpack/src/extensions/host/HostBootdiskButtons.js +71 -0
- data/webpack/src/extensions/host/HostBootdiskButtonsSelectors.js +27 -0
- data/webpack/src/extensions/host/__tests__/HostBootdiskButtonsSelectors.test.js +66 -0
- data/webpack/src/extensions/host/__tests__/__snapshots__/HostBootdiskButtonsSelectors.test.js.snap +30 -0
- metadata +47 -21
- data/.github/workflows/rubocop.yaml +0 -19
- data/.tx/config +0 -8
- data/AUTHORS +0 -34
- data/release-gem +0 -84
- data/test/functional/foreman_bootdisk/api/v2/disks_controller_test.rb +0 -97
- data/test/functional/foreman_bootdisk/api/v2/subnet_disks_controller_test.rb +0 -37
- data/test/functional/foreman_bootdisk/disks_controller_test.rb +0 -97
- data/test/functional/foreman_bootdisk/subnet_disks_controller_test.rb +0 -51
- data/test/models/host/managed_test.rb +0 -26
- data/test/test_plugin_helper.rb +0 -72
- data/test/unit/access_permissions_test.rb +0 -10
- data/test/unit/concerns/compute_resources/vmware_test.rb +0 -83
- data/test/unit/concerns/host_test.rb +0 -84
- data/test/unit/concerns/orchestration/compute_test.rb +0 -69
- data/test/unit/foreman_bootdisk/renderer_test.rb +0 -36
- data/test/unit/foreman_bootdisk/scope/bootdisk_test.rb +0 -31
- data/test/unit/foreman_bootdisk/scope/full_host_bootdisk_test.rb +0 -30
- data/test/unit/iso_generator_test.rb +0 -74
@@ -0,0 +1,27 @@
|
|
1
|
+
import { STATUS } from 'foremanReact/constants';
|
2
|
+
import {
|
3
|
+
selectAPIStatus,
|
4
|
+
selectAPIResponse,
|
5
|
+
} from 'foremanReact/redux/API/APISelectors';
|
6
|
+
|
7
|
+
import {
|
8
|
+
HOST_BOOTDISK_BUTTONS_REQUEST_KEY,
|
9
|
+
HOST_DETAILS_REQUEST_KEY,
|
10
|
+
} from '../constants';
|
11
|
+
|
12
|
+
const selectHostButtonsResponse = state =>
|
13
|
+
selectAPIResponse(state, HOST_BOOTDISK_BUTTONS_REQUEST_KEY) || {};
|
14
|
+
|
15
|
+
export const selectBootdiskOptions = state =>
|
16
|
+
selectHostButtonsResponse(state).bootdiskOptions || {};
|
17
|
+
|
18
|
+
const selectHostButtonsStatus = state =>
|
19
|
+
selectAPIStatus(state, HOST_BOOTDISK_BUTTONS_REQUEST_KEY);
|
20
|
+
|
21
|
+
export const selectIsLoading = state => {
|
22
|
+
const status = selectHostButtonsStatus(state);
|
23
|
+
return !status || status === STATUS.PENDING;
|
24
|
+
};
|
25
|
+
|
26
|
+
export const selectHostId = state =>
|
27
|
+
selectAPIResponse(state, HOST_DETAILS_REQUEST_KEY).id;
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
2
|
+
|
3
|
+
import {
|
4
|
+
selectHostId,
|
5
|
+
selectIsLoading,
|
6
|
+
selectBootdiskOptions,
|
7
|
+
} from '../HostBootdiskButtonsSelectors';
|
8
|
+
|
9
|
+
import {
|
10
|
+
HOST_DETAILS_REQUEST_KEY,
|
11
|
+
HOST_BOOTDISK_BUTTONS_REQUEST_KEY,
|
12
|
+
} from '../../constants';
|
13
|
+
|
14
|
+
const stateFactory = (bootdiskState, hostState) => ({
|
15
|
+
API: {
|
16
|
+
[HOST_DETAILS_REQUEST_KEY]: {
|
17
|
+
response: {
|
18
|
+
...hostState,
|
19
|
+
},
|
20
|
+
},
|
21
|
+
[HOST_BOOTDISK_BUTTONS_REQUEST_KEY]: {
|
22
|
+
response: {
|
23
|
+
...bootdiskState,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
},
|
27
|
+
});
|
28
|
+
|
29
|
+
const state = stateFactory(
|
30
|
+
{
|
31
|
+
bootdiskOptions: {
|
32
|
+
bootdiskDownloadable: true,
|
33
|
+
architectureName: 'x86_64',
|
34
|
+
actions: [
|
35
|
+
{
|
36
|
+
title: "Host 'sppup' image",
|
37
|
+
link: '/bootdisk/disks/hosts/8',
|
38
|
+
disabled: false,
|
39
|
+
description: null,
|
40
|
+
},
|
41
|
+
{
|
42
|
+
title: "Full host 'sppup' image",
|
43
|
+
link: '/bootdisk/disks/full_hosts/8',
|
44
|
+
disabled: true,
|
45
|
+
description: 'Host is not in build mode',
|
46
|
+
},
|
47
|
+
{
|
48
|
+
title: 'Boot disk help',
|
49
|
+
link: '/bootdisk/disks/help',
|
50
|
+
},
|
51
|
+
],
|
52
|
+
},
|
53
|
+
},
|
54
|
+
{
|
55
|
+
id: 8,
|
56
|
+
}
|
57
|
+
);
|
58
|
+
|
59
|
+
const fixtures = {
|
60
|
+
'should return options': () => selectBootdiskOptions(state),
|
61
|
+
'should return isLoading': () => selectIsLoading(state),
|
62
|
+
'should return hostId': () => selectHostId(state),
|
63
|
+
};
|
64
|
+
|
65
|
+
describe('HostBootdiskButtons selectors', () =>
|
66
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|
data/webpack/src/extensions/host/__tests__/__snapshots__/HostBootdiskButtonsSelectors.test.js.snap
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
+
|
3
|
+
exports[`HostBootdiskButtons selectors should return hostId 1`] = `8`;
|
4
|
+
|
5
|
+
exports[`HostBootdiskButtons selectors should return isLoading 1`] = `true`;
|
6
|
+
|
7
|
+
exports[`HostBootdiskButtons selectors should return options 1`] = `
|
8
|
+
Object {
|
9
|
+
"actions": Array [
|
10
|
+
Object {
|
11
|
+
"description": null,
|
12
|
+
"disabled": false,
|
13
|
+
"link": "/bootdisk/disks/hosts/8",
|
14
|
+
"title": "Host 'sppup' image",
|
15
|
+
},
|
16
|
+
Object {
|
17
|
+
"description": "Host is not in build mode",
|
18
|
+
"disabled": true,
|
19
|
+
"link": "/bootdisk/disks/full_hosts/8",
|
20
|
+
"title": "Full host 'sppup' image",
|
21
|
+
},
|
22
|
+
Object {
|
23
|
+
"link": "/bootdisk/disks/help",
|
24
|
+
"title": "Boot disk help",
|
25
|
+
},
|
26
|
+
],
|
27
|
+
"architectureName": "x86_64",
|
28
|
+
"bootdiskDownloadable": true,
|
29
|
+
}
|
30
|
+
`;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_bootdisk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 19.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominic Cleal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: theforeman-rubocop
|
@@ -48,9 +48,6 @@ extra_rdoc_files:
|
|
48
48
|
- LICENSE
|
49
49
|
- README.md
|
50
50
|
files:
|
51
|
-
- ".github/workflows/rubocop.yaml"
|
52
|
-
- ".tx/config"
|
53
|
-
- AUTHORS
|
54
51
|
- CHANGES.md
|
55
52
|
- LICENSE
|
56
53
|
- README.md
|
@@ -99,52 +96,81 @@ files:
|
|
99
96
|
- locale/Makefile
|
100
97
|
- locale/action_names.rb
|
101
98
|
- locale/ca/LC_MESSAGES/foreman_bootdisk.mo
|
99
|
+
- locale/ca/foreman_bootdisk.edit.po
|
102
100
|
- locale/ca/foreman_bootdisk.po
|
101
|
+
- locale/ca/foreman_bootdisk.po.time_stamp
|
103
102
|
- locale/de/LC_MESSAGES/foreman_bootdisk.mo
|
103
|
+
- locale/de/foreman_bootdisk.edit.po
|
104
104
|
- locale/de/foreman_bootdisk.po
|
105
|
+
- locale/de/foreman_bootdisk.po.time_stamp
|
105
106
|
- locale/en/LC_MESSAGES/foreman_bootdisk.mo
|
107
|
+
- locale/en/foreman_bootdisk.edit.po
|
106
108
|
- locale/en/foreman_bootdisk.po
|
109
|
+
- locale/en/foreman_bootdisk.po.time_stamp
|
107
110
|
- locale/en_GB/LC_MESSAGES/foreman_bootdisk.mo
|
111
|
+
- locale/en_GB/foreman_bootdisk.edit.po
|
108
112
|
- locale/en_GB/foreman_bootdisk.po
|
113
|
+
- locale/en_GB/foreman_bootdisk.po.time_stamp
|
109
114
|
- locale/es/LC_MESSAGES/foreman_bootdisk.mo
|
115
|
+
- locale/es/foreman_bootdisk.edit.po
|
110
116
|
- locale/es/foreman_bootdisk.po
|
117
|
+
- locale/es/foreman_bootdisk.po.time_stamp
|
111
118
|
- locale/foreman_bootdisk.pot
|
112
119
|
- locale/fr/LC_MESSAGES/foreman_bootdisk.mo
|
120
|
+
- locale/fr/foreman_bootdisk.edit.po
|
113
121
|
- locale/fr/foreman_bootdisk.po
|
122
|
+
- locale/fr/foreman_bootdisk.po.time_stamp
|
114
123
|
- locale/gemspec.rb
|
115
124
|
- locale/it/LC_MESSAGES/foreman_bootdisk.mo
|
125
|
+
- locale/it/foreman_bootdisk.edit.po
|
116
126
|
- locale/it/foreman_bootdisk.po
|
127
|
+
- locale/it/foreman_bootdisk.po.time_stamp
|
117
128
|
- locale/ja/LC_MESSAGES/foreman_bootdisk.mo
|
129
|
+
- locale/ja/foreman_bootdisk.edit.po
|
118
130
|
- locale/ja/foreman_bootdisk.po
|
131
|
+
- locale/ja/foreman_bootdisk.po.time_stamp
|
119
132
|
- locale/ko/LC_MESSAGES/foreman_bootdisk.mo
|
133
|
+
- locale/ko/foreman_bootdisk.edit.po
|
120
134
|
- locale/ko/foreman_bootdisk.po
|
135
|
+
- locale/ko/foreman_bootdisk.po.time_stamp
|
121
136
|
- locale/pt_BR/LC_MESSAGES/foreman_bootdisk.mo
|
137
|
+
- locale/pt_BR/foreman_bootdisk.edit.po
|
122
138
|
- locale/pt_BR/foreman_bootdisk.po
|
139
|
+
- locale/pt_BR/foreman_bootdisk.po.time_stamp
|
123
140
|
- locale/ru/LC_MESSAGES/foreman_bootdisk.mo
|
141
|
+
- locale/ru/foreman_bootdisk.edit.po
|
124
142
|
- locale/ru/foreman_bootdisk.po
|
143
|
+
- locale/ru/foreman_bootdisk.po.time_stamp
|
125
144
|
- locale/sv_SE/LC_MESSAGES/foreman_bootdisk.mo
|
145
|
+
- locale/sv_SE/foreman_bootdisk.edit.po
|
126
146
|
- locale/sv_SE/foreman_bootdisk.po
|
147
|
+
- locale/sv_SE/foreman_bootdisk.po.time_stamp
|
127
148
|
- locale/zanata.xml
|
128
149
|
- locale/zh_CN/LC_MESSAGES/foreman_bootdisk.mo
|
150
|
+
- locale/zh_CN/foreman_bootdisk.edit.po
|
129
151
|
- locale/zh_CN/foreman_bootdisk.po
|
152
|
+
- locale/zh_CN/foreman_bootdisk.po.time_stamp
|
130
153
|
- locale/zh_TW/LC_MESSAGES/foreman_bootdisk.mo
|
154
|
+
- locale/zh_TW/foreman_bootdisk.edit.po
|
131
155
|
- locale/zh_TW/foreman_bootdisk.po
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
-
|
140
|
-
-
|
141
|
-
-
|
142
|
-
-
|
143
|
-
-
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
147
|
-
|
156
|
+
- locale/zh_TW/foreman_bootdisk.po.time_stamp
|
157
|
+
- package.json
|
158
|
+
- webpack/__mocks__/foremanReact/common/HOC.js
|
159
|
+
- webpack/__mocks__/foremanReact/common/I18n.js
|
160
|
+
- webpack/__mocks__/foremanReact/common/helpers.js
|
161
|
+
- webpack/__mocks__/foremanReact/common/urlHelpers.js
|
162
|
+
- webpack/__mocks__/foremanReact/constants.js
|
163
|
+
- webpack/__mocks__/foremanReact/redux/API/APISelectors.js
|
164
|
+
- webpack/__mocks__/foremanReact/redux/API/index.js
|
165
|
+
- webpack/global_index.js
|
166
|
+
- webpack/global_test_setup.js
|
167
|
+
- webpack/index.js
|
168
|
+
- webpack/src/extensions/constants.js
|
169
|
+
- webpack/src/extensions/host/HostBootdiskButtons.js
|
170
|
+
- webpack/src/extensions/host/HostBootdiskButtonsSelectors.js
|
171
|
+
- webpack/src/extensions/host/__tests__/HostBootdiskButtonsSelectors.test.js
|
172
|
+
- webpack/src/extensions/host/__tests__/__snapshots__/HostBootdiskButtonsSelectors.test.js.snap
|
173
|
+
homepage: https://github.com/theforeman/foreman_bootdisk
|
148
174
|
licenses:
|
149
175
|
- GPL-3.0
|
150
176
|
metadata: {}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
name: Rubocop
|
2
|
-
|
3
|
-
on: [pull_request]
|
4
|
-
|
5
|
-
jobs:
|
6
|
-
rubocop:
|
7
|
-
runs-on: ubuntu-latest
|
8
|
-
env:
|
9
|
-
BUNDLE_FOREMAN: '0'
|
10
|
-
BUNDLE_WITHOUT: development:test
|
11
|
-
steps:
|
12
|
-
- uses: actions/checkout@v2
|
13
|
-
- name: Setup Ruby
|
14
|
-
uses: ruby/setup-ruby@v1
|
15
|
-
with:
|
16
|
-
ruby-version: 2.5
|
17
|
-
bundler-cache: true
|
18
|
-
- name: Run rubocop
|
19
|
-
run: bundle exec rubocop -P --format github
|
data/.tx/config
DELETED
data/AUTHORS
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
Adam Ruzicka
|
2
|
-
Bernhard Suttner
|
3
|
-
Bryan Kearney
|
4
|
-
crito
|
5
|
-
Damon Maria
|
6
|
-
Dominic Cleal
|
7
|
-
Dominik Matoulek
|
8
|
-
Greg Sutcliffe
|
9
|
-
Ido Kanner
|
10
|
-
Jon Fautley
|
11
|
-
Justin Sherrill
|
12
|
-
Leos Stejskal
|
13
|
-
Lukas Zapletal
|
14
|
-
Lukáš Zapletal
|
15
|
-
Marek Hulan
|
16
|
-
Marek Hulán
|
17
|
-
Markus Bucher
|
18
|
-
Martin Bačovský
|
19
|
-
Michael Hofer
|
20
|
-
Michael Moll
|
21
|
-
Ohad Levy
|
22
|
-
Oleh Fedorenko
|
23
|
-
Ondrej Prazak
|
24
|
-
Ondřej Ezr
|
25
|
-
Ondřej Pražák
|
26
|
-
Pat Riehecky
|
27
|
-
Robert Antoni Buj Gelonch
|
28
|
-
Rohan21Lobo
|
29
|
-
Ronald van Zantvoort
|
30
|
-
Sam Kottler
|
31
|
-
Sean O'Keeffe
|
32
|
-
Stephen Benjamin
|
33
|
-
Swapnil Abnave
|
34
|
-
Timo Goebel
|
data/release-gem
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
#!/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
# rubocop:disable all
|
4
|
-
|
5
|
-
$plugin_name = "foreman_bootdisk"
|
6
|
-
RUBY_VERSION_FILE = "lib/#{$plugin_name}/version.rb"
|
7
|
-
|
8
|
-
def die(msg)
|
9
|
-
STDERR.puts msg; exit 1
|
10
|
-
end
|
11
|
-
|
12
|
-
def run(cmd)
|
13
|
-
puts `#{cmd}`
|
14
|
-
die("Command #{cmd} failed with #{$?}!") if $?.to_i != 0
|
15
|
-
true
|
16
|
-
end
|
17
|
-
|
18
|
-
def action(question)
|
19
|
-
puts "#{question} ? [Y/n]"
|
20
|
-
die("Aborted.") if STDIN.gets.chomp.match(/^(n|no|nope)$/i)
|
21
|
-
die("Check failed, exiting.") if block_given? && ! yield
|
22
|
-
end
|
23
|
-
|
24
|
-
action "Extracted strings with: rake plugin:gettext[#{$plugin_name}] (Foreman dir)"
|
25
|
-
|
26
|
-
action "Pulled updates with: make -C locale tx-update"
|
27
|
-
|
28
|
-
action "Merged the updates with: rake plugin:gettext[#{$plugin_name}] (Foreman dir)"
|
29
|
-
|
30
|
-
action "Rebuilt the MO files with: make -C locale mo-files" do
|
31
|
-
Dir["locale/**/*.po"].each do |po|
|
32
|
-
mo = po.sub(/#{$plugin_name}\.po$/, "LC_MESSAGES/#{$plugin_name}.mo")
|
33
|
-
puts("Warning, file #{mo} does not exist!") unless File.exist?(mo)
|
34
|
-
puts("Warning, file #{mo} outdated!") if File.mtime(po) > File.mtime(mo)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
action "Want me to update AUTHORS file" do
|
39
|
-
run "git log --pretty=format:'%an' | sort -u > AUTHORS"
|
40
|
-
end
|
41
|
-
|
42
|
-
action "Modified lib/#{$plugin_name}/engine.rb to match minimum Foreman core version"
|
43
|
-
|
44
|
-
action "Modified #{RUBY_VERSION_FILE} to match desired version"
|
45
|
-
|
46
|
-
action "Created 'Version X.Y' commit with engine.rb/version.rb change"
|
47
|
-
|
48
|
-
action "Created git tag" do
|
49
|
-
$git_version = `git describe --abbrev=0 --tags`.chomp.sub("v", "")
|
50
|
-
$git_version == File.read(RUBY_VERSION_FILE).match(/VERSION\s*=\s'([0-9\.]+)'/)[1]
|
51
|
-
end
|
52
|
-
|
53
|
-
action "Is version #{$git_version} the one to be released"
|
54
|
-
|
55
|
-
$gem_filename = "#{$plugin_name}-#{$git_version}.gem"
|
56
|
-
action "Shall I build the #{$gem_filename} now" do
|
57
|
-
run "gem build #{$plugin_name}.gemspec"
|
58
|
-
end
|
59
|
-
|
60
|
-
action "Investigated the #{$gem_filename} via gem compare -k -b #{$plugin_name} OLD #{$git_version} -k" do
|
61
|
-
run "tar -xOf #{$gem_filename} data.tar.gz | tar -z -list | sort"
|
62
|
-
end
|
63
|
-
|
64
|
-
action "Created and built OS distribution packages"
|
65
|
-
|
66
|
-
action "Updated dependencies in both RPM and DEB spec files"
|
67
|
-
|
68
|
-
action "All commits and *tags* pushed to origin"
|
69
|
-
|
70
|
-
action "Shell I push the #{$gem_filename} to rubygems.org now" do
|
71
|
-
run "gem push #{$gem_filename}"
|
72
|
-
end
|
73
|
-
|
74
|
-
action "Is https://rubygems.org/gems/#{$plugin_name} looking good"
|
75
|
-
|
76
|
-
action "Created new stable branch and pushed to origin"
|
77
|
-
|
78
|
-
action "Updated documentation at www.theforeman.org?"
|
79
|
-
|
80
|
-
action "Updated jenkins_job_builder http://bit.ly/2iZKR3B branch"
|
81
|
-
|
82
|
-
puts "Well done! Go ahead and create documentation and changelog:"
|
83
|
-
puts " git log --pretty=format:'%s' develop...X.Y.Z"
|
84
|
-
puts " git log --pretty=format:'%an' develop...X.Y.Z | sort -u"
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_plugin_helper'
|
4
|
-
|
5
|
-
class ForemanBootdisk::Api::V2::DisksControllerTest < ActionController::TestCase
|
6
|
-
include ForemanBootdiskTestHelper
|
7
|
-
setup :setup_bootdisk
|
8
|
-
setup :setup_referer
|
9
|
-
setup :setup_org_loc
|
10
|
-
|
11
|
-
def perform_generic_generate
|
12
|
-
tmp = create_tempfile
|
13
|
-
ForemanBootdisk::ISOGenerator.expects(:generate).yields(create_tempfile.path)
|
14
|
-
get :generic
|
15
|
-
assert_response :success
|
16
|
-
ensure
|
17
|
-
tmp.unlink
|
18
|
-
end
|
19
|
-
|
20
|
-
def perform_host_generate
|
21
|
-
tmp = create_tempfile
|
22
|
-
ForemanBootdisk::ISOGenerator.expects(:generate).yields(create_tempfile.path)
|
23
|
-
get :host, params: { id: @host.name }
|
24
|
-
assert_response :success
|
25
|
-
ensure
|
26
|
-
tmp.unlink
|
27
|
-
end
|
28
|
-
|
29
|
-
def perform_full_host_generate
|
30
|
-
tmp = create_tempfile
|
31
|
-
ForemanBootdisk::ISOGenerator.expects(:generate_full_host).yields(create_tempfile.path)
|
32
|
-
get :host, params: { id: @host.name, full: true }
|
33
|
-
assert_response :success
|
34
|
-
ensure
|
35
|
-
tmp.unlink
|
36
|
-
end
|
37
|
-
|
38
|
-
describe '#generic with TFTP' do
|
39
|
-
setup :setup_subnet_with_tftp
|
40
|
-
setup :setup_host
|
41
|
-
|
42
|
-
test 'should generate generic image' do
|
43
|
-
perform_generic_generate
|
44
|
-
end
|
45
|
-
|
46
|
-
test 'should generate host image' do
|
47
|
-
perform_host_generate
|
48
|
-
end
|
49
|
-
|
50
|
-
test 'should generate full host image' do
|
51
|
-
perform_full_host_generate
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe '#subnet_host with TFTP and HTTPBOOT' do
|
56
|
-
setup :setup_subnet_with_tftp_httpboot_template
|
57
|
-
setup :setup_host
|
58
|
-
|
59
|
-
test 'should generate generic image' do
|
60
|
-
perform_generic_generate
|
61
|
-
end
|
62
|
-
|
63
|
-
test 'should generate host image' do
|
64
|
-
perform_host_generate
|
65
|
-
end
|
66
|
-
|
67
|
-
test 'should generate full host image' do
|
68
|
-
perform_full_host_generate
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
describe 'default API version 2' do
|
73
|
-
setup :setup_host_env
|
74
|
-
|
75
|
-
test 'path - /api/hosts/:host_id routes to #host' do
|
76
|
-
expected_path = if Rails::VERSION::MAJOR >= 5
|
77
|
-
"/api/v2/hosts/#{@host.id}"
|
78
|
-
else
|
79
|
-
"/api/hosts/#{@host.id}"
|
80
|
-
end
|
81
|
-
assert_routing expected_path,
|
82
|
-
format: 'json',
|
83
|
-
apiv: 'v2',
|
84
|
-
controller: 'foreman_bootdisk/api/v2/disks',
|
85
|
-
action: 'host',
|
86
|
-
id: @host.id.to_s
|
87
|
-
end
|
88
|
-
|
89
|
-
test 'path - /api/generic routes to #generic' do
|
90
|
-
assert_routing '/api/generic',
|
91
|
-
format: 'json',
|
92
|
-
apiv: 'v2',
|
93
|
-
controller: 'foreman_bootdisk/api/v2/disks',
|
94
|
-
action: 'generic'
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_plugin_helper'
|
4
|
-
|
5
|
-
class ForemanBootdisk::Api::V2::SubnetDisksControllerTest < ActionController::TestCase
|
6
|
-
include ForemanBootdiskTestHelper
|
7
|
-
setup :setup_bootdisk
|
8
|
-
setup :setup_referer
|
9
|
-
setup :setup_org_loc
|
10
|
-
|
11
|
-
def perform_subnet_generate
|
12
|
-
tmp = create_tempfile
|
13
|
-
ForemanBootdisk::ISOGenerator.expects(:generate).yields(create_tempfile.path)
|
14
|
-
get :subnet, params: { id: @host.subnet.id }
|
15
|
-
assert_response :success
|
16
|
-
ensure
|
17
|
-
tmp.unlink
|
18
|
-
end
|
19
|
-
|
20
|
-
describe '#subnet_host with TFTP' do
|
21
|
-
setup :setup_subnet_with_tftp
|
22
|
-
setup :setup_host
|
23
|
-
|
24
|
-
test 'should generate subnet generic host image' do
|
25
|
-
perform_subnet_generate
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
describe '#subnet_host with TFTP and HTTPBOOT' do
|
30
|
-
setup :setup_subnet_with_tftp_httpboot_template
|
31
|
-
setup :setup_host
|
32
|
-
|
33
|
-
test 'should generate subnet generic host image' do
|
34
|
-
perform_subnet_generate
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,97 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_plugin_helper'
|
4
|
-
|
5
|
-
class ForemanBootdisk::DisksControllerTest < ActionController::TestCase
|
6
|
-
include ForemanBootdiskTestHelper
|
7
|
-
setup :setup_bootdisk
|
8
|
-
setup :setup_referer
|
9
|
-
setup :setup_org_loc
|
10
|
-
|
11
|
-
def perform_generic_generate
|
12
|
-
tmp = create_tempfile
|
13
|
-
ForemanBootdisk::ISOGenerator.expects(:generate).yields(create_tempfile.path)
|
14
|
-
get :generic, session: set_session_user
|
15
|
-
assert_response :success
|
16
|
-
ensure
|
17
|
-
tmp.unlink
|
18
|
-
end
|
19
|
-
|
20
|
-
def perform_host_generate
|
21
|
-
tmp = create_tempfile
|
22
|
-
ForemanBootdisk::ISOGenerator.expects(:generate).yields(create_tempfile.path)
|
23
|
-
get :host, params: { id: @host.name }, session: set_session_user
|
24
|
-
assert_response :success
|
25
|
-
ensure
|
26
|
-
tmp.unlink
|
27
|
-
end
|
28
|
-
|
29
|
-
def perform_full_host_generate
|
30
|
-
tmp = create_tempfile
|
31
|
-
ForemanBootdisk::ISOGenerator.expects(:generate_full_host).yields(create_tempfile.path)
|
32
|
-
get :full_host, params: { id: @host.name }, session: set_session_user
|
33
|
-
assert_response :success
|
34
|
-
ensure
|
35
|
-
tmp.unlink
|
36
|
-
end
|
37
|
-
|
38
|
-
describe '#generic with TFTP' do
|
39
|
-
setup :setup_subnet_with_tftp
|
40
|
-
setup :setup_host
|
41
|
-
|
42
|
-
test 'should generate generic image' do
|
43
|
-
perform_generic_generate
|
44
|
-
end
|
45
|
-
|
46
|
-
test 'should generate host image' do
|
47
|
-
perform_host_generate
|
48
|
-
end
|
49
|
-
|
50
|
-
test 'should generate full host image' do
|
51
|
-
perform_full_host_generate
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
describe '#subnet_host with TFTP and HTTPBOOT' do
|
56
|
-
setup :setup_subnet_with_tftp_httpboot_template
|
57
|
-
setup :setup_host
|
58
|
-
|
59
|
-
test 'should generate generic image' do
|
60
|
-
perform_generic_generate
|
61
|
-
end
|
62
|
-
|
63
|
-
test 'should generate host image' do
|
64
|
-
perform_host_generate
|
65
|
-
end
|
66
|
-
|
67
|
-
test 'should generate full host image' do
|
68
|
-
perform_full_host_generate
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
describe '#host without tftp' do
|
73
|
-
setup :setup_referer
|
74
|
-
setup :setup_org_loc
|
75
|
-
setup :setup_subnet_no_tftp
|
76
|
-
setup :setup_host
|
77
|
-
|
78
|
-
test 'should prolong token for host image' do
|
79
|
-
Setting[:token_duration] = 60
|
80
|
-
@host.set_token
|
81
|
-
past = Time.now
|
82
|
-
assert @host.token.expires > past
|
83
|
-
travel_to(past + 2.hours)
|
84
|
-
assert @host.token_expired?
|
85
|
-
|
86
|
-
perform_full_host_generate
|
87
|
-
|
88
|
-
assert_equal @host.token_expired?, true
|
89
|
-
assert @host.token.expires > past
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
test 'should render help' do
|
94
|
-
get :help, session: set_session_user
|
95
|
-
assert_response :success
|
96
|
-
end
|
97
|
-
end
|
@@ -1,51 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_plugin_helper'
|
4
|
-
|
5
|
-
class ForemanBootdisk::SubnetDisksControllerTest < ActionController::TestCase
|
6
|
-
include ForemanBootdiskTestHelper
|
7
|
-
setup :setup_bootdisk
|
8
|
-
setup :setup_referer
|
9
|
-
setup :setup_org_loc
|
10
|
-
|
11
|
-
def perform_subnet_generate
|
12
|
-
tmp = create_tempfile
|
13
|
-
ForemanBootdisk::ISOGenerator.expects(:generate).yields(create_tempfile.path)
|
14
|
-
get :subnet, params: { id: @subnet.id }, session: set_session_user
|
15
|
-
assert_empty flash[:error]
|
16
|
-
assert_response :success
|
17
|
-
ensure
|
18
|
-
tmp.unlink
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '#generic with TFTP' do
|
22
|
-
setup :setup_subnet_with_tftp
|
23
|
-
setup :setup_host
|
24
|
-
|
25
|
-
test 'should generate subnet image' do
|
26
|
-
perform_subnet_generate
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
describe '#subnet_host with TFTP and HTTPBOOT' do
|
31
|
-
setup :setup_subnet_with_tftp_httpboot_template
|
32
|
-
setup :setup_host
|
33
|
-
|
34
|
-
test 'should generate subnet image' do
|
35
|
-
perform_subnet_generate
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
describe '#host without tftp' do
|
40
|
-
setup :setup_referer
|
41
|
-
setup :setup_org_loc
|
42
|
-
setup :setup_subnet_no_tftp
|
43
|
-
setup :setup_host
|
44
|
-
|
45
|
-
test 'should not generate subnet image' do
|
46
|
-
get :subnet, params: { id: @subnet.id }, session: set_session_user
|
47
|
-
assert_match(/Failed.*: TFTP feature not enabled/, flash[:error])
|
48
|
-
assert_response :redirect
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|