foreman_bootdisk 17.0.2 → 19.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/app/controllers/concerns/allowed_actions.rb +16 -0
  4. data/app/controllers/foreman_bootdisk/api/v2/disks_controller.rb +11 -2
  5. data/app/controllers/foreman_bootdisk/api/v2/subnet_disks_controller.rb +7 -0
  6. data/app/controllers/foreman_bootdisk/disks_controller.rb +71 -19
  7. data/app/controllers/foreman_bootdisk/subnet_disks_controller.rb +41 -0
  8. data/app/helpers/bootdisk_links_helper.rb +46 -0
  9. data/app/helpers/concerns/foreman_bootdisk/hosts_helper_ext.rb +57 -43
  10. data/app/helpers/concerns/foreman_bootdisk/pretty_error.rb +13 -0
  11. data/app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb +45 -0
  12. data/app/helpers/disk_helper.rb +8 -0
  13. data/app/lib/foreman_bootdisk/scope/bootdisk.rb +24 -0
  14. data/app/models/concerns/foreman_bootdisk/host_ext.rb +6 -0
  15. data/app/models/concerns/foreman_bootdisk/orchestration/compute.rb +10 -3
  16. data/app/models/setting/bootdisk.rb +10 -1
  17. data/app/services/foreman_bootdisk/iso_generator.rb +23 -5
  18. data/app/views/foreman_bootdisk/disks/help.html.erb +16 -4
  19. data/app/views/foreman_bootdisk/generic_efi_host.erb +4 -0
  20. data/app/views/foreman_bootdisk/host.erb +7 -0
  21. data/app/views/subnets/_bootdisk_action_buttons.erb +1 -0
  22. data/app/views/subnets/_bootdisk_title_buttons.erb +1 -0
  23. data/config/routes.rb +2 -1
  24. data/db/migrate/20140522185700_change_templatekind_to_bootdisk.rb +3 -11
  25. data/lib/foreman_bootdisk/engine.rb +14 -2
  26. data/lib/foreman_bootdisk/version.rb +1 -1
  27. data/lib/tasks/bootdisk.rake +1 -19
  28. data/locale/action_names.rb +1 -1
  29. data/locale/ca/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  30. data/locale/ca/foreman_bootdisk.edit.po +393 -0
  31. data/locale/ca/foreman_bootdisk.po +47 -11
  32. data/locale/ca/foreman_bootdisk.po.time_stamp +0 -0
  33. data/locale/de/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  34. data/locale/de/foreman_bootdisk.edit.po +398 -0
  35. data/locale/de/foreman_bootdisk.po +63 -26
  36. data/locale/de/foreman_bootdisk.po.time_stamp +0 -0
  37. data/locale/en/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  38. data/locale/en/foreman_bootdisk.edit.po +388 -0
  39. data/locale/en/foreman_bootdisk.po +45 -9
  40. data/locale/en/foreman_bootdisk.po.time_stamp +0 -0
  41. data/locale/en_GB/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  42. data/locale/en_GB/foreman_bootdisk.edit.po +394 -0
  43. data/locale/en_GB/foreman_bootdisk.po +47 -11
  44. data/locale/en_GB/foreman_bootdisk.po.time_stamp +0 -0
  45. data/locale/es/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  46. data/locale/es/foreman_bootdisk.edit.po +394 -0
  47. data/locale/es/foreman_bootdisk.po +69 -32
  48. data/locale/es/foreman_bootdisk.po.time_stamp +0 -0
  49. data/locale/foreman_bootdisk.pot +121 -63
  50. data/locale/fr/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  51. data/locale/fr/foreman_bootdisk.edit.po +394 -0
  52. data/locale/fr/foreman_bootdisk.po +80 -43
  53. data/locale/fr/foreman_bootdisk.po.time_stamp +0 -0
  54. data/locale/it/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  55. data/locale/it/foreman_bootdisk.edit.po +391 -0
  56. data/locale/it/foreman_bootdisk.po +47 -11
  57. data/locale/it/foreman_bootdisk.po.time_stamp +0 -0
  58. data/locale/ja/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  59. data/locale/ja/foreman_bootdisk.edit.po +393 -0
  60. data/locale/ja/foreman_bootdisk.po +70 -33
  61. data/locale/ja/foreman_bootdisk.po.time_stamp +0 -0
  62. data/locale/ko/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  63. data/locale/ko/foreman_bootdisk.edit.po +390 -0
  64. data/locale/ko/foreman_bootdisk.po +47 -11
  65. data/locale/ko/foreman_bootdisk.po.time_stamp +0 -0
  66. data/locale/pt_BR/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  67. data/locale/pt_BR/foreman_bootdisk.edit.po +394 -0
  68. data/locale/pt_BR/foreman_bootdisk.po +79 -43
  69. data/locale/pt_BR/foreman_bootdisk.po.time_stamp +0 -0
  70. data/locale/ru/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  71. data/locale/ru/foreman_bootdisk.edit.po +395 -0
  72. data/locale/ru/foreman_bootdisk.po +47 -11
  73. data/locale/ru/foreman_bootdisk.po.time_stamp +0 -0
  74. data/locale/sv_SE/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  75. data/locale/sv_SE/foreman_bootdisk.edit.po +392 -0
  76. data/locale/sv_SE/foreman_bootdisk.po +47 -11
  77. data/locale/sv_SE/foreman_bootdisk.po.time_stamp +0 -0
  78. data/locale/zh_CN/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  79. data/locale/zh_CN/foreman_bootdisk.edit.po +391 -0
  80. data/locale/zh_CN/foreman_bootdisk.po +113 -77
  81. data/locale/zh_CN/foreman_bootdisk.po.time_stamp +0 -0
  82. data/locale/zh_TW/LC_MESSAGES/foreman_bootdisk.mo +0 -0
  83. data/locale/zh_TW/foreman_bootdisk.edit.po +391 -0
  84. data/locale/zh_TW/foreman_bootdisk.po +47 -11
  85. data/locale/zh_TW/foreman_bootdisk.po.time_stamp +0 -0
  86. data/package.json +42 -0
  87. data/webpack/__mocks__/foremanReact/common/HOC.js +30 -0
  88. data/webpack/__mocks__/foremanReact/common/I18n.js +7 -0
  89. data/webpack/__mocks__/foremanReact/common/helpers.js +7 -0
  90. data/webpack/__mocks__/foremanReact/common/urlHelpers.js +8 -0
  91. data/webpack/__mocks__/foremanReact/constants.js +24 -0
  92. data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +6 -0
  93. data/webpack/__mocks__/foremanReact/redux/API/index.js +10 -0
  94. data/webpack/global_index.js +12 -0
  95. data/webpack/global_test_setup.js +11 -0
  96. data/webpack/index.js +0 -0
  97. data/webpack/src/extensions/constants.js +2 -0
  98. data/webpack/src/extensions/host/HostBootdiskButtons.js +71 -0
  99. data/webpack/src/extensions/host/HostBootdiskButtonsSelectors.js +27 -0
  100. data/webpack/src/extensions/host/__tests__/HostBootdiskButtonsSelectors.test.js +66 -0
  101. data/webpack/src/extensions/host/__tests__/__snapshots__/HostBootdiskButtonsSelectors.test.js.snap +30 -0
  102. metadata +60 -66
  103. data/.tx/config +0 -8
  104. data/AUTHORS +0 -30
  105. data/release-gem +0 -84
  106. data/test/functional/foreman_bootdisk/api/v2/disks_controller_test.rb +0 -97
  107. data/test/functional/foreman_bootdisk/api/v2/subnet_disks_controller_test.rb +0 -37
  108. data/test/functional/foreman_bootdisk/disks_controller_test.rb +0 -107
  109. data/test/models/host/managed_test.rb +0 -26
  110. data/test/test_plugin_helper.rb +0 -72
  111. data/test/unit/access_permissions_test.rb +0 -10
  112. data/test/unit/concerns/compute_resources/vmware_test.rb +0 -83
  113. data/test/unit/concerns/host_test.rb +0 -84
  114. data/test/unit/concerns/orchestration/compute_test.rb +0 -69
  115. data/test/unit/foreman_bootdisk/renderer_test.rb +0 -36
  116. data/test/unit/foreman_bootdisk/scope/bootdisk_test.rb +0 -31
  117. data/test/unit/foreman_bootdisk/scope/full_host_bootdisk_test.rb +0 -30
  118. 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,10 @@
1
+ export const API = {
2
+ get: jest.fn(),
3
+ put: jest.fn(),
4
+ post: jest.fn(),
5
+ delete: jest.fn(),
6
+ patch: jest.fn(),
7
+ };
8
+
9
+ export const get = data => ({ type: 'get-some-type', ...data });
10
+ export const post = data => ({ type: 'post-some-type', ...data });
@@ -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,2 @@
1
+ export const HOST_BOOTDISK_BUTTONS_REQUEST_KEY = 'HOST_BOOTDISK_BUTTONS';
2
+ export const HOST_DETAILS_REQUEST_KEY = 'HOST_DETAILS';
@@ -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));
@@ -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,59 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_bootdisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.0.2
4
+ version: 19.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-15 00:00:00.000000000 Z
11
+ date: 2021-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rubocop
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rubocop-minitest
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rubocop-performance
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop-rails
14
+ name: theforeman-rubocop
57
15
  requirement: !ruby/object:Gem::Requirement
58
16
  requirements:
59
17
  - - ">="
@@ -90,16 +48,20 @@ extra_rdoc_files:
90
48
  - LICENSE
91
49
  - README.md
92
50
  files:
93
- - ".tx/config"
94
- - AUTHORS
95
51
  - CHANGES.md
96
52
  - LICENSE
97
53
  - README.md
98
54
  - app/assets/javascripts/foreman_bootdisk/host_edit.js
55
+ - app/controllers/concerns/allowed_actions.rb
99
56
  - app/controllers/foreman_bootdisk/api/v2/disks_controller.rb
100
57
  - app/controllers/foreman_bootdisk/api/v2/subnet_disks_controller.rb
101
58
  - app/controllers/foreman_bootdisk/disks_controller.rb
59
+ - app/controllers/foreman_bootdisk/subnet_disks_controller.rb
60
+ - app/helpers/bootdisk_links_helper.rb
102
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
103
65
  - app/lib/foreman_bootdisk/scope/bootdisk.rb
104
66
  - app/lib/foreman_bootdisk/scope/full_host_bootdisk.rb
105
67
  - app/lib/foreman_bootdisk/scope/full_host_bootdisk_efi.rb
@@ -115,6 +77,8 @@ files:
115
77
  - app/views/foreman_bootdisk/generic_static_host.erb
116
78
  - app/views/foreman_bootdisk/host.erb
117
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
118
82
  - config/routes.rb
119
83
  - config/routes/mount_engine.rb
120
84
  - db/migrate/20130914211030_create_host_bootdisk_template.rb
@@ -132,55 +96,85 @@ files:
132
96
  - locale/Makefile
133
97
  - locale/action_names.rb
134
98
  - locale/ca/LC_MESSAGES/foreman_bootdisk.mo
99
+ - locale/ca/foreman_bootdisk.edit.po
135
100
  - locale/ca/foreman_bootdisk.po
101
+ - locale/ca/foreman_bootdisk.po.time_stamp
136
102
  - locale/de/LC_MESSAGES/foreman_bootdisk.mo
103
+ - locale/de/foreman_bootdisk.edit.po
137
104
  - locale/de/foreman_bootdisk.po
105
+ - locale/de/foreman_bootdisk.po.time_stamp
138
106
  - locale/en/LC_MESSAGES/foreman_bootdisk.mo
107
+ - locale/en/foreman_bootdisk.edit.po
139
108
  - locale/en/foreman_bootdisk.po
109
+ - locale/en/foreman_bootdisk.po.time_stamp
140
110
  - locale/en_GB/LC_MESSAGES/foreman_bootdisk.mo
111
+ - locale/en_GB/foreman_bootdisk.edit.po
141
112
  - locale/en_GB/foreman_bootdisk.po
113
+ - locale/en_GB/foreman_bootdisk.po.time_stamp
142
114
  - locale/es/LC_MESSAGES/foreman_bootdisk.mo
115
+ - locale/es/foreman_bootdisk.edit.po
143
116
  - locale/es/foreman_bootdisk.po
117
+ - locale/es/foreman_bootdisk.po.time_stamp
144
118
  - locale/foreman_bootdisk.pot
145
119
  - locale/fr/LC_MESSAGES/foreman_bootdisk.mo
120
+ - locale/fr/foreman_bootdisk.edit.po
146
121
  - locale/fr/foreman_bootdisk.po
122
+ - locale/fr/foreman_bootdisk.po.time_stamp
147
123
  - locale/gemspec.rb
148
124
  - locale/it/LC_MESSAGES/foreman_bootdisk.mo
125
+ - locale/it/foreman_bootdisk.edit.po
149
126
  - locale/it/foreman_bootdisk.po
127
+ - locale/it/foreman_bootdisk.po.time_stamp
150
128
  - locale/ja/LC_MESSAGES/foreman_bootdisk.mo
129
+ - locale/ja/foreman_bootdisk.edit.po
151
130
  - locale/ja/foreman_bootdisk.po
131
+ - locale/ja/foreman_bootdisk.po.time_stamp
152
132
  - locale/ko/LC_MESSAGES/foreman_bootdisk.mo
133
+ - locale/ko/foreman_bootdisk.edit.po
153
134
  - locale/ko/foreman_bootdisk.po
135
+ - locale/ko/foreman_bootdisk.po.time_stamp
154
136
  - locale/pt_BR/LC_MESSAGES/foreman_bootdisk.mo
137
+ - locale/pt_BR/foreman_bootdisk.edit.po
155
138
  - locale/pt_BR/foreman_bootdisk.po
139
+ - locale/pt_BR/foreman_bootdisk.po.time_stamp
156
140
  - locale/ru/LC_MESSAGES/foreman_bootdisk.mo
141
+ - locale/ru/foreman_bootdisk.edit.po
157
142
  - locale/ru/foreman_bootdisk.po
143
+ - locale/ru/foreman_bootdisk.po.time_stamp
158
144
  - locale/sv_SE/LC_MESSAGES/foreman_bootdisk.mo
145
+ - locale/sv_SE/foreman_bootdisk.edit.po
159
146
  - locale/sv_SE/foreman_bootdisk.po
147
+ - locale/sv_SE/foreman_bootdisk.po.time_stamp
160
148
  - locale/zanata.xml
161
149
  - locale/zh_CN/LC_MESSAGES/foreman_bootdisk.mo
150
+ - locale/zh_CN/foreman_bootdisk.edit.po
162
151
  - locale/zh_CN/foreman_bootdisk.po
152
+ - locale/zh_CN/foreman_bootdisk.po.time_stamp
163
153
  - locale/zh_TW/LC_MESSAGES/foreman_bootdisk.mo
154
+ - locale/zh_TW/foreman_bootdisk.edit.po
164
155
  - locale/zh_TW/foreman_bootdisk.po
165
- - release-gem
166
- - test/functional/foreman_bootdisk/api/v2/disks_controller_test.rb
167
- - test/functional/foreman_bootdisk/api/v2/subnet_disks_controller_test.rb
168
- - test/functional/foreman_bootdisk/disks_controller_test.rb
169
- - test/models/host/managed_test.rb
170
- - test/test_plugin_helper.rb
171
- - test/unit/access_permissions_test.rb
172
- - test/unit/concerns/compute_resources/vmware_test.rb
173
- - test/unit/concerns/host_test.rb
174
- - test/unit/concerns/orchestration/compute_test.rb
175
- - test/unit/foreman_bootdisk/renderer_test.rb
176
- - test/unit/foreman_bootdisk/scope/bootdisk_test.rb
177
- - test/unit/foreman_bootdisk/scope/full_host_bootdisk_test.rb
178
- - test/unit/iso_generator_test.rb
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
179
173
  homepage: http://github.com/theforeman/foreman_bootdisk
180
174
  licenses:
181
175
  - GPL-3.0
182
176
  metadata: {}
183
- post_install_message:
177
+ post_install_message:
184
178
  rdoc_options: []
185
179
  require_paths:
186
180
  - lib
@@ -188,15 +182,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
188
182
  requirements:
189
183
  - - ">="
190
184
  - !ruby/object:Gem::Version
191
- version: '0'
185
+ version: '2.5'
192
186
  required_rubygems_version: !ruby/object:Gem::Requirement
193
187
  requirements:
194
188
  - - ">="
195
189
  - !ruby/object:Gem::Version
196
190
  version: '0'
197
191
  requirements: []
198
- rubygems_version: 3.0.3
199
- signing_key:
192
+ rubygems_version: 3.1.4
193
+ signing_key:
200
194
  specification_version: 4
201
195
  summary: Create boot disks to provision hosts with Foreman
202
196
  test_files: []
data/.tx/config DELETED
@@ -1,8 +0,0 @@
1
- [main]
2
- host = https://www.transifex.com
3
-
4
- [foreman.bootdisk]
5
- file_filter = locale/<lang>/foreman_bootdisk.edit.po
6
- source_file = locale/foreman_bootdisk.pot
7
- source_lang = en
8
- type = PO
data/AUTHORS DELETED
@@ -1,30 +0,0 @@
1
- Adam Ruzicka
2
- Bernhard Suttner
3
- Bryan Kearney
4
- crito
5
- Damon Maria
6
- Dominic Cleal
7
- Greg Sutcliffe
8
- Ido Kanner
9
- Jon Fautley
10
- Justin Sherrill
11
- Leos Stejskal
12
- Lukas Zapletal
13
- Lukáš Zapletal
14
- Marek Hulan
15
- Marek Hulán
16
- Martin Bačovský
17
- Michael Hofer
18
- Michael Moll
19
- Ohad Levy
20
- Ondrej Prazak
21
- Ondřej Ezr
22
- Ondřej Pražák
23
- Robert Antoni Buj Gelonch
24
- Rohan21Lobo
25
- Ronald van Zantvoort
26
- Sam Kottler
27
- Sean O'Keeffe
28
- Stephen Benjamin
29
- Swapnil Abnave
30
- 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