summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Tomasek <jtomasek@redhat.com>2017-05-05 14:31:13 +0200
committerJiri Tomasek <jtomasek@redhat.com>2017-06-19 11:58:17 +0200
commite873eb178c1e7489e57cfd87d10f9d9cf1358427 (patch)
tree966392d3847c26d61d04e46315b26efe572fffc7
parent7372bbfb868dd904b3541668d13706abf0aee544 (diff)
Fix nodes registrationstable/ocata
* Don't include uuid in nodes registration * Add IPMI port to driver fields Closes-Bug: 1689507 Closes-Bug: 1688543 Change-Id: I35df26175aa3fe44970420d8e1f0936fc1005337 (cherry picked from commit 2b7419299896eba7aa1238c74c5f4ad09835a9cd)
Notes
Notes (review): Code-Review+2: Florian Fuchs <flfuchs@redhat.com> Code-Review+2: Honza Pokorny <honza@redhat.com> Workflow+1: Honza Pokorny <honza@redhat.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 19 Jun 2017 13:19:19 +0000 Reviewed-on: https://review.openstack.org/475314 Project: openstack/tripleo-ui Branch: refs/heads/stable/ocata
-rw-r--r--releasenotes/notes/nodes-register-port-080747965014e1b3.yaml6
-rw-r--r--src/js/components/nodes/driver_fields/DriverFields.js75
-rw-r--r--src/js/components/nodes/driver_fields/PXEAndDRACDriverFields.js15
-rw-r--r--src/js/components/nodes/driver_fields/PXEAndIPMIToolDriverFields.js15
-rw-r--r--src/js/components/nodes/driver_fields/PXEAndSSHDriverFields.js15
-rw-r--r--src/js/immutableRecords/nodes.js4
6 files changed, 93 insertions, 37 deletions
diff --git a/releasenotes/notes/nodes-register-port-080747965014e1b3.yaml b/releasenotes/notes/nodes-register-port-080747965014e1b3.yaml
new file mode 100644
index 0000000..56d51ac
--- /dev/null
+++ b/releasenotes/notes/nodes-register-port-080747965014e1b3.yaml
@@ -0,0 +1,6 @@
1fixes:
2 - |
3 Fixes `bug 1689507 <https://launchpad.net/bugs/1689507>`__
4 IPMI port is now possible to specify when registering Nodes.
5 Fixes `bug 1688543 <https://launchpad.net/bugs/1688543>`__
6 Node UUID is not generated by UI when registering nodes any more.
diff --git a/src/js/components/nodes/driver_fields/DriverFields.js b/src/js/components/nodes/driver_fields/DriverFields.js
index 1dd8c0c..d29de9b 100644
--- a/src/js/components/nodes/driver_fields/DriverFields.js
+++ b/src/js/components/nodes/driver_fields/DriverFields.js
@@ -9,6 +9,10 @@ const messages = defineMessages({
9 ipOrFqdnValidatorMessage: { 9 ipOrFqdnValidatorMessage: {
10 id: 'DriverFields.ipOrFqdnValidatorMessage', 10 id: 'DriverFields.ipOrFqdnValidatorMessage',
11 defaultMessage: 'Please enter a valid IPv4 Address or a valid FQDN.' 11 defaultMessage: 'Please enter a valid IPv4 Address or a valid FQDN.'
12 },
13 portValidationMessage: {
14 id: 'DriverFields.portValidationMessage',
15 defaultMessage: 'Please enter valid Port number (0 - 65535)'
12 } 16 }
13}); 17});
14 18
@@ -16,38 +20,60 @@ class DriverFields extends React.Component {
16 constructor(props) { 20 constructor(props) {
17 super(props); 21 super(props);
18 22
19 let ip_regex = '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]' + 23 let ip_regex =
20 '[0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'; 24 '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9]' +
25 '[0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$';
21 let fqdn_regex = '^(?!:\/\/)([a-zA-Z0-9]+\.)?[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,6}?$'; 26 let fqdn_regex = '^(?!:\/\/)([a-zA-Z0-9]+\.)?[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,6}?$';
22 27
23 this.ipOrFqdnValidator = {matchRegexp: new RegExp(ip_regex + '|' + fqdn_regex)}; 28 this.portRegex =
29 '^([0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}' + '|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$$';
30
31 this.ipOrFqdnValidator = {
32 matchRegexp: new RegExp(ip_regex + '|' + fqdn_regex)
33 };
24 this.ipOrFqdnValidatorMessage = this.props.intl.formatMessage( 34 this.ipOrFqdnValidatorMessage = this.props.intl.formatMessage(
25 messages.ipOrFqdnValidatorMessage); 35 messages.ipOrFqdnValidatorMessage
36 );
26 } 37 }
27 38
28 render() { 39 render() {
29 return ( 40 return (
30 <div> 41 <div>
31 <HorizontalInput name="pm_addr" 42 <HorizontalInput
32 title={this.props.addr_title} 43 name="pm_addr"
33 inputColumnClasses="col-sm-7" 44 title={this.props.addr_title}
34 labelColumnClasses="col-sm-5" 45 inputColumnClasses="col-sm-7"
35 value={this.props.node.pm_addr} 46 labelColumnClasses="col-sm-5"
36 validations={this.ipOrFqdnValidator} 47 value={this.props.node.pm_addr}
37 validationError={this.ipOrFqdnValidatorMessage} 48 validations={this.ipOrFqdnValidator}
38 required /> 49 validationError={this.ipOrFqdnValidatorMessage}
39 <HorizontalInput name="pm_user" 50 required
40 title={this.props.user_title} 51 />
41 inputColumnClasses="col-sm-7" 52 <HorizontalInput
42 labelColumnClasses="col-sm-5" 53 name="pm_port"
43 value={this.props.node.pm_user} 54 title={this.props.port_title}
44 required /> 55 inputColumnClasses="col-sm-7"
45 <HorizontalTextarea name="pm_password" 56 labelColumnClasses="col-sm-5"
46 title={this.props.pwd_title} 57 value={this.props.node.pm_port}
47 inputColumnClasses="col-sm-7" 58 validations={{ matchRegexp: new RegExp(this.portRegex) }}
48 labelColumnClasses="col-sm-5" 59 validationError={this.props.intl.formatMessage(messages.portValidationMessage)}
49 value={this.props.node.pm_password} 60 />
50 required /> 61 <HorizontalInput
62 name="pm_user"
63 title={this.props.user_title}
64 inputColumnClasses="col-sm-7"
65 labelColumnClasses="col-sm-5"
66 value={this.props.node.pm_user}
67 required
68 />
69 <HorizontalTextarea
70 name="pm_password"
71 title={this.props.pwd_title}
72 inputColumnClasses="col-sm-7"
73 labelColumnClasses="col-sm-5"
74 value={this.props.node.pm_password}
75 required
76 />
51 </div> 77 </div>
52 ); 78 );
53 } 79 }
@@ -56,6 +82,7 @@ DriverFields.propTypes = {
56 addr_title: React.PropTypes.string.isRequired, 82 addr_title: React.PropTypes.string.isRequired,
57 intl: React.PropTypes.object, 83 intl: React.PropTypes.object,
58 node: ImmutablePropTypes.record.isRequired, 84 node: ImmutablePropTypes.record.isRequired,
85 port_title: React.PropTypes.string.isRequired,
59 pwd_title: React.PropTypes.string.isRequired, 86 pwd_title: React.PropTypes.string.isRequired,
60 user_title: React.PropTypes.string.isRequired 87 user_title: React.PropTypes.string.isRequired
61}; 88};
diff --git a/src/js/components/nodes/driver_fields/PXEAndDRACDriverFields.js b/src/js/components/nodes/driver_fields/PXEAndDRACDriverFields.js
index b6b2985..18016df 100644
--- a/src/js/components/nodes/driver_fields/PXEAndDRACDriverFields.js
+++ b/src/js/components/nodes/driver_fields/PXEAndDRACDriverFields.js
@@ -8,6 +8,10 @@ const messages = defineMessages({
8 id: 'PXEAndDRACDriverFields.addr_title', 8 id: 'PXEAndDRACDriverFields.addr_title',
9 defaultMessage: 'DRAC Host' 9 defaultMessage: 'DRAC Host'
10 }, 10 },
11 port_title: {
12 id: 'PXEAndDRACDriverFields.port_title',
13 defaultMessage: 'DRAC Port'
14 },
11 user_title: { 15 user_title: {
12 id: 'PXEAndDRACDriverFields.user_title', 16 id: 'PXEAndDRACDriverFields.user_title',
13 defaultMessage: 'DRAC Username' 17 defaultMessage: 'DRAC Username'
@@ -21,10 +25,13 @@ const messages = defineMessages({
21class PXEAndDRACDriverFields extends React.Component { 25class PXEAndDRACDriverFields extends React.Component {
22 render() { 26 render() {
23 return ( 27 return (
24 <DriverFields {...this.props} 28 <DriverFields
25 addr_title={this.props.intl.formatMessage(messages.addr_title)} 29 {...this.props}
26 user_title={this.props.intl.formatMessage(messages.user_title)} 30 addr_title={this.props.intl.formatMessage(messages.addr_title)}
27 pwd_title={this.props.intl.formatMessage(messages.pwd_title)} /> 31 user_title={this.props.intl.formatMessage(messages.user_title)}
32 port_title={this.props.intl.formatMessage(messages.port_title)}
33 pwd_title={this.props.intl.formatMessage(messages.pwd_title)}
34 />
28 ); 35 );
29 } 36 }
30} 37}
diff --git a/src/js/components/nodes/driver_fields/PXEAndIPMIToolDriverFields.js b/src/js/components/nodes/driver_fields/PXEAndIPMIToolDriverFields.js
index d84c387..cb33f53 100644
--- a/src/js/components/nodes/driver_fields/PXEAndIPMIToolDriverFields.js
+++ b/src/js/components/nodes/driver_fields/PXEAndIPMIToolDriverFields.js
@@ -8,6 +8,10 @@ const messages = defineMessages({
8 id: 'PXEAndIPMIToolDriverFields.addr_title', 8 id: 'PXEAndIPMIToolDriverFields.addr_title',
9 defaultMessage: 'IPMI IP Address or FQDN' 9 defaultMessage: 'IPMI IP Address or FQDN'
10 }, 10 },
11 port_title: {
12 id: 'PXEAndIPMIToolDriverFields.port_title',
13 defaultMessage: 'IPMI Port'
14 },
11 user_title: { 15 user_title: {
12 id: 'PXEAndIPMIToolDriverFields.user_title', 16 id: 'PXEAndIPMIToolDriverFields.user_title',
13 defaultMessage: 'IPMI Username' 17 defaultMessage: 'IPMI Username'
@@ -21,10 +25,13 @@ const messages = defineMessages({
21class PXEAndIPMIToolDriverFields extends React.Component { 25class PXEAndIPMIToolDriverFields extends React.Component {
22 render() { 26 render() {
23 return ( 27 return (
24 <DriverFields {...this.props} 28 <DriverFields
25 addr_title={this.props.intl.formatMessage(messages.addr_title)} 29 {...this.props}
26 user_title={this.props.intl.formatMessage(messages.user_title)} 30 addr_title={this.props.intl.formatMessage(messages.addr_title)}
27 pwd_title={this.props.intl.formatMessage(messages.pwd_title)} /> 31 user_title={this.props.intl.formatMessage(messages.user_title)}
32 port_title={this.props.intl.formatMessage(messages.port_title)}
33 pwd_title={this.props.intl.formatMessage(messages.pwd_title)}
34 />
28 ); 35 );
29 } 36 }
30} 37}
diff --git a/src/js/components/nodes/driver_fields/PXEAndSSHDriverFields.js b/src/js/components/nodes/driver_fields/PXEAndSSHDriverFields.js
index 9b0bb25..2bec071 100644
--- a/src/js/components/nodes/driver_fields/PXEAndSSHDriverFields.js
+++ b/src/js/components/nodes/driver_fields/PXEAndSSHDriverFields.js
@@ -8,6 +8,10 @@ const messages = defineMessages({
8 id: 'PXEAndSSHDriverFields.addr_title', 8 id: 'PXEAndSSHDriverFields.addr_title',
9 defaultMessage: 'SSH IP Address or FQDN' 9 defaultMessage: 'SSH IP Address or FQDN'
10 }, 10 },
11 port_title: {
12 id: 'PXEAndSSHDriverFields.port_title',
13 defaultMessage: 'SSH Port'
14 },
11 user_title: { 15 user_title: {
12 id: 'PXEAndSSHDriverFields.user_title', 16 id: 'PXEAndSSHDriverFields.user_title',
13 defaultMessage: 'SSH User' 17 defaultMessage: 'SSH User'
@@ -21,10 +25,13 @@ const messages = defineMessages({
21class PXEAndSSHDriverFields extends React.Component { 25class PXEAndSSHDriverFields extends React.Component {
22 render() { 26 render() {
23 return ( 27 return (
24 <DriverFields {...this.props} 28 <DriverFields
25 addr_title={this.props.intl.formatMessage(messages.addr_title)} 29 {...this.props}
26 user_title={this.props.intl.formatMessage(messages.user_title)} 30 addr_title={this.props.intl.formatMessage(messages.addr_title)}
27 pwd_title={this.props.intl.formatMessage(messages.pwd_title)} /> 31 user_title={this.props.intl.formatMessage(messages.user_title)}
32 port_title={this.props.intl.formatMessage(messages.port_title)}
33 pwd_title={this.props.intl.formatMessage(messages.pwd_title)}
34 />
28 ); 35 );
29 } 36 }
30} 37}
diff --git a/src/js/immutableRecords/nodes.js b/src/js/immutableRecords/nodes.js
index 7ae10a8..1b7a8bb 100644
--- a/src/js/immutableRecords/nodes.js
+++ b/src/js/immutableRecords/nodes.js
@@ -8,6 +8,7 @@ export const NodeToRegister = Record({
8 pm_user: undefined, 8 pm_user: undefined,
9 pm_addr: undefined, 9 pm_addr: undefined,
10 pm_password: undefined, 10 pm_password: undefined,
11 pm_port: undefined,
11 arch: undefined, 12 arch: undefined,
12 cpu: undefined, 13 cpu: undefined,
13 memory: undefined, 14 memory: undefined,
@@ -16,13 +17,14 @@ export const NodeToRegister = Record({
16}); 17});
17 18
18export const IronicNode = Record({ 19export const IronicNode = Record({
19 uuid: undefined, 20 // uuid: undefined, TODO(jtomasek): re-add this once registration supports passing uuid
20 name: undefined, 21 name: undefined,
21 mac: List(), 22 mac: List(),
22 pm_type: 'pxe_ssh', 23 pm_type: 'pxe_ssh',
23 pm_user: undefined, 24 pm_user: undefined,
24 pm_addr: undefined, 25 pm_addr: undefined,
25 pm_password: undefined, 26 pm_password: undefined,
27 pm_port: undefined,
26 arch: undefined, 28 arch: undefined,
27 cpu: undefined, 29 cpu: undefined,
28 memory: undefined, 30 memory: undefined,