foreman_bootdisk 17.1.0 → 19.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/app/controllers/foreman_bootdisk/api/v2/disks_controller.rb +7 -2
- data/app/controllers/foreman_bootdisk/disks_controller.rb +70 -21
- data/app/controllers/foreman_bootdisk/subnet_disks_controller.rb +41 -0
- data/app/helpers/bootdisk_links_helper.rb +46 -0
- data/app/helpers/concerns/foreman_bootdisk/hosts_helper_ext.rb +30 -42
- data/app/helpers/concerns/foreman_bootdisk/pretty_error.rb +13 -0
- data/app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb +45 -0
- data/app/helpers/disk_helper.rb +8 -0
- data/app/views/foreman_bootdisk/disks/help.html.erb +16 -4
- data/app/views/subnets/_bootdisk_action_buttons.erb +1 -0
- data/app/views/subnets/_bootdisk_title_buttons.erb +1 -0
- data/config/routes.rb +2 -1
- data/db/migrate/20140522185700_change_templatekind_to_bootdisk.rb +3 -3
- data/lib/foreman_bootdisk/engine.rb +11 -2
- data/lib/foreman_bootdisk/version.rb +1 -1
- data/locale/action_names.rb +2 -4
- 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 +47 -11
- 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 +63 -26
- 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 +45 -9
- 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 +47 -11
- 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 +69 -32
- data/locale/es/foreman_bootdisk.po.time_stamp +0 -0
- data/locale/foreman_bootdisk.pot +121 -63
- 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 +80 -43
- 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 +47 -11
- 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 +70 -33
- 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 +47 -11
- 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 +79 -43
- 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 +47 -11
- 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 +47 -11
- 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 +113 -77
- 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 +47 -11
- 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 +54 -20
- 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 -107
- 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,6 @@
|
|
1
|
+
export const selectAPIResponse = (state, key) =>
|
2
|
+
selectAPIByKey(state, key).response;
|
3
|
+
|
4
|
+
export const selectAPIStatus = (state, key) => 'PENDING';
|
5
|
+
export const selectAPIByKey = (state, key) => state.API[key];
|
6
|
+
export const selectAPIError = (state, key) => ({ error: `${key} ERRROR` });
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
3
|
+
import { addGlobalFill } from 'foremanReact/components/common/Fill/GlobalFill';
|
4
|
+
|
5
|
+
import HostBootdiskButtons from './src/extensions/host/HostBootdiskButtons';
|
6
|
+
|
7
|
+
addGlobalFill(
|
8
|
+
'host-details-kebab',
|
9
|
+
'host-bootdisk-buttons',
|
10
|
+
<HostBootdiskButtons key="host-bootdisk-buttons" />,
|
11
|
+
300
|
12
|
+
);
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// runs before each test to make sure console.error output will
|
2
|
+
// fail a test (i.e. default PropType missing). Check the error
|
3
|
+
// output and traceback for actual error.
|
4
|
+
global.console.error = (error, stack) => {
|
5
|
+
/* eslint-disable-next-line no-console */
|
6
|
+
if (stack) console.log(stack); // Prints out original stack trace
|
7
|
+
throw new Error(error);
|
8
|
+
};
|
9
|
+
|
10
|
+
// Increase jest timeout as some tests using multiple http mocks can time out on CI systems.
|
11
|
+
jest.setTimeout(10000);
|
data/webpack/index.js
ADDED
File without changes
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import React, { useEffect } from 'react';
|
2
|
+
import { useSelector, useDispatch } from 'react-redux';
|
3
|
+
|
4
|
+
import { DropdownItem, DropdownGroup } from '@patternfly/react-core';
|
5
|
+
|
6
|
+
import { get } from 'foremanReact/redux/API';
|
7
|
+
import { foremanUrl } from 'foremanReact/common/helpers';
|
8
|
+
import { sprintf, translate as __ } from 'foremanReact/common/I18n';
|
9
|
+
|
10
|
+
import Loading from 'foremanReact/components/Loading';
|
11
|
+
|
12
|
+
import { HOST_BOOTDISK_BUTTONS_REQUEST_KEY } from '../constants';
|
13
|
+
|
14
|
+
import {
|
15
|
+
selectHostId,
|
16
|
+
selectIsLoading,
|
17
|
+
selectBootdiskOptions,
|
18
|
+
} from './HostBootdiskButtonsSelectors';
|
19
|
+
|
20
|
+
const HostBootdiskButtons = () => {
|
21
|
+
const dispatch = useDispatch();
|
22
|
+
const hostId = useSelector(selectHostId);
|
23
|
+
const isLoading = useSelector(selectIsLoading);
|
24
|
+
const options = useSelector(selectBootdiskOptions);
|
25
|
+
|
26
|
+
useEffect(() => {
|
27
|
+
dispatch(
|
28
|
+
get({
|
29
|
+
key: HOST_BOOTDISK_BUTTONS_REQUEST_KEY,
|
30
|
+
url: foremanUrl(`/bootdisk/disks/bootdisk_options/${hostId}`),
|
31
|
+
})
|
32
|
+
);
|
33
|
+
}, [dispatch, hostId]);
|
34
|
+
|
35
|
+
let content = null;
|
36
|
+
if (options.bootdiskDownloadable) {
|
37
|
+
content = options.actions.map((action, i) => (
|
38
|
+
<DropdownItem
|
39
|
+
key={`bootdisk-${i}`}
|
40
|
+
href={foremanUrl(action.link)}
|
41
|
+
isDisabled={action.disabled}
|
42
|
+
description={action.description}
|
43
|
+
>
|
44
|
+
{action.title}
|
45
|
+
</DropdownItem>
|
46
|
+
));
|
47
|
+
} else {
|
48
|
+
content = (
|
49
|
+
<DropdownItem
|
50
|
+
key="bootdisk-unavailable"
|
51
|
+
component="button"
|
52
|
+
href="#"
|
53
|
+
tooltip={sprintf(
|
54
|
+
__('Boot disk download not available for %s architecture'),
|
55
|
+
options.architectureName
|
56
|
+
)}
|
57
|
+
tooltipProps={{ entryDelay: 0, exitDelay: 0 }}
|
58
|
+
>
|
59
|
+
{__('Not available')}
|
60
|
+
</DropdownItem>
|
61
|
+
);
|
62
|
+
}
|
63
|
+
|
64
|
+
return (
|
65
|
+
<DropdownGroup label={__('Boot disk')} key="bootdisk-group">
|
66
|
+
{isLoading ? <Loading showText={false} /> : content}
|
67
|
+
</DropdownGroup>
|
68
|
+
);
|
69
|
+
};
|
70
|
+
|
71
|
+
export default HostBootdiskButtons;
|
@@ -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.1
|
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-12 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
|
@@ -59,7 +56,12 @@ files:
|
|
59
56
|
- app/controllers/foreman_bootdisk/api/v2/disks_controller.rb
|
60
57
|
- app/controllers/foreman_bootdisk/api/v2/subnet_disks_controller.rb
|
61
58
|
- app/controllers/foreman_bootdisk/disks_controller.rb
|
59
|
+
- app/controllers/foreman_bootdisk/subnet_disks_controller.rb
|
60
|
+
- app/helpers/bootdisk_links_helper.rb
|
62
61
|
- app/helpers/concerns/foreman_bootdisk/hosts_helper_ext.rb
|
62
|
+
- app/helpers/concerns/foreman_bootdisk/pretty_error.rb
|
63
|
+
- app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
|
64
|
+
- app/helpers/disk_helper.rb
|
63
65
|
- app/lib/foreman_bootdisk/scope/bootdisk.rb
|
64
66
|
- app/lib/foreman_bootdisk/scope/full_host_bootdisk.rb
|
65
67
|
- app/lib/foreman_bootdisk/scope/full_host_bootdisk_efi.rb
|
@@ -75,6 +77,8 @@ files:
|
|
75
77
|
- app/views/foreman_bootdisk/generic_static_host.erb
|
76
78
|
- app/views/foreman_bootdisk/host.erb
|
77
79
|
- app/views/hosts/provision_method/bootdisk/_form.html.erb
|
80
|
+
- app/views/subnets/_bootdisk_action_buttons.erb
|
81
|
+
- app/views/subnets/_bootdisk_title_buttons.erb
|
78
82
|
- config/routes.rb
|
79
83
|
- config/routes/mount_engine.rb
|
80
84
|
- db/migrate/20130914211030_create_host_bootdisk_template.rb
|
@@ -92,51 +96,81 @@ files:
|
|
92
96
|
- locale/Makefile
|
93
97
|
- locale/action_names.rb
|
94
98
|
- locale/ca/LC_MESSAGES/foreman_bootdisk.mo
|
99
|
+
- locale/ca/foreman_bootdisk.edit.po
|
95
100
|
- locale/ca/foreman_bootdisk.po
|
101
|
+
- locale/ca/foreman_bootdisk.po.time_stamp
|
96
102
|
- locale/de/LC_MESSAGES/foreman_bootdisk.mo
|
103
|
+
- locale/de/foreman_bootdisk.edit.po
|
97
104
|
- locale/de/foreman_bootdisk.po
|
105
|
+
- locale/de/foreman_bootdisk.po.time_stamp
|
98
106
|
- locale/en/LC_MESSAGES/foreman_bootdisk.mo
|
107
|
+
- locale/en/foreman_bootdisk.edit.po
|
99
108
|
- locale/en/foreman_bootdisk.po
|
109
|
+
- locale/en/foreman_bootdisk.po.time_stamp
|
100
110
|
- locale/en_GB/LC_MESSAGES/foreman_bootdisk.mo
|
111
|
+
- locale/en_GB/foreman_bootdisk.edit.po
|
101
112
|
- locale/en_GB/foreman_bootdisk.po
|
113
|
+
- locale/en_GB/foreman_bootdisk.po.time_stamp
|
102
114
|
- locale/es/LC_MESSAGES/foreman_bootdisk.mo
|
115
|
+
- locale/es/foreman_bootdisk.edit.po
|
103
116
|
- locale/es/foreman_bootdisk.po
|
117
|
+
- locale/es/foreman_bootdisk.po.time_stamp
|
104
118
|
- locale/foreman_bootdisk.pot
|
105
119
|
- locale/fr/LC_MESSAGES/foreman_bootdisk.mo
|
120
|
+
- locale/fr/foreman_bootdisk.edit.po
|
106
121
|
- locale/fr/foreman_bootdisk.po
|
122
|
+
- locale/fr/foreman_bootdisk.po.time_stamp
|
107
123
|
- locale/gemspec.rb
|
108
124
|
- locale/it/LC_MESSAGES/foreman_bootdisk.mo
|
125
|
+
- locale/it/foreman_bootdisk.edit.po
|
109
126
|
- locale/it/foreman_bootdisk.po
|
127
|
+
- locale/it/foreman_bootdisk.po.time_stamp
|
110
128
|
- locale/ja/LC_MESSAGES/foreman_bootdisk.mo
|
129
|
+
- locale/ja/foreman_bootdisk.edit.po
|
111
130
|
- locale/ja/foreman_bootdisk.po
|
131
|
+
- locale/ja/foreman_bootdisk.po.time_stamp
|
112
132
|
- locale/ko/LC_MESSAGES/foreman_bootdisk.mo
|
133
|
+
- locale/ko/foreman_bootdisk.edit.po
|
113
134
|
- locale/ko/foreman_bootdisk.po
|
135
|
+
- locale/ko/foreman_bootdisk.po.time_stamp
|
114
136
|
- locale/pt_BR/LC_MESSAGES/foreman_bootdisk.mo
|
137
|
+
- locale/pt_BR/foreman_bootdisk.edit.po
|
115
138
|
- locale/pt_BR/foreman_bootdisk.po
|
139
|
+
- locale/pt_BR/foreman_bootdisk.po.time_stamp
|
116
140
|
- locale/ru/LC_MESSAGES/foreman_bootdisk.mo
|
141
|
+
- locale/ru/foreman_bootdisk.edit.po
|
117
142
|
- locale/ru/foreman_bootdisk.po
|
143
|
+
- locale/ru/foreman_bootdisk.po.time_stamp
|
118
144
|
- locale/sv_SE/LC_MESSAGES/foreman_bootdisk.mo
|
145
|
+
- locale/sv_SE/foreman_bootdisk.edit.po
|
119
146
|
- locale/sv_SE/foreman_bootdisk.po
|
147
|
+
- locale/sv_SE/foreman_bootdisk.po.time_stamp
|
120
148
|
- locale/zanata.xml
|
121
149
|
- locale/zh_CN/LC_MESSAGES/foreman_bootdisk.mo
|
150
|
+
- locale/zh_CN/foreman_bootdisk.edit.po
|
122
151
|
- locale/zh_CN/foreman_bootdisk.po
|
152
|
+
- locale/zh_CN/foreman_bootdisk.po.time_stamp
|
123
153
|
- locale/zh_TW/LC_MESSAGES/foreman_bootdisk.mo
|
154
|
+
- locale/zh_TW/foreman_bootdisk.edit.po
|
124
155
|
- locale/zh_TW/foreman_bootdisk.po
|
125
|
-
-
|
126
|
-
-
|
127
|
-
-
|
128
|
-
-
|
129
|
-
-
|
130
|
-
-
|
131
|
-
-
|
132
|
-
-
|
133
|
-
-
|
134
|
-
-
|
135
|
-
-
|
136
|
-
-
|
137
|
-
-
|
138
|
-
-
|
139
|
-
|
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
|
140
174
|
licenses:
|
141
175
|
- GPL-3.0
|
142
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
|