Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Traffic Ops ISO Generation process to work with management interfaces #1198

Merged
merged 7 commits into from
Sep 22, 2017

Conversation

dneuman64
Copy link
Contributor

Sometimes a server requires that users access on a management network interface instead of through the payload network interface. Traffic Ops did not have the ability to support passing management network interface information to the kickstart scripts, even though the data was in the database. This change makes it so that management network interface information can be provided and sent to the kickstart scripts.

@dneuman64 dneuman64 added Traffic Ops related to Traffic Ops Traffic Ops API Traffic Portal v1 related to Traffic Portal version 1 labels Sep 20, 2017
@dneuman64 dneuman64 added this to the 2.2.0 milestone Sep 20, 2017
}

sub is_valid {
my $self = shift;
my $params = shift;

my $rules = {
fields => [qw/osversionDir hostName domainName rootPass dhcp ipAddress ipNetmask ipGateway ip6Address ip6Gateway interfaceName interfaceMtu disk/],
fields => [qw/osversionDir hostName domainName rootPass dhcp ipAddress ipNetmask ipGateway ip6Address ip6Gateway interfaceName interfaceMtu disk mgmtInterface mgmtIpGateway/],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you need to add 2 more things to "fields". probably not a big deal but i think "fields" is supposed to represent ALL params

mgmtIpAddress
mgmtIpNetmask

<div class="form-group" ng-class="{'has-error': hasError(isoForm.disk), 'has-feedback': hasError(isoForm.disk)}">
<label class="control-label col-md-2 col-sm-2 col-xs-12">Disk for OS Install</label>
<label class="control-label col-md-2 col-sm-2 col-xs-12">Disk for OS Install*</label>
<div class="col-md-10 col-sm-10 col-xs-12">
<input id="disk" name="disk" type="text" class="form-control" placeholder='Typical values are "sda"' ng-model="iso.disk" ng-maxlength="8" autofocus>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure you add "required" to your input form element if disk is now required, otherwise TP code looks good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I figured that was just for fields you wanted to validate. Fixed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i see your commit but make sure you add "required" to your input form element like this:

https://github.com/apache/incubator-trafficcontrol/blob/master/traffic_portal/app/src/common/modules/form/iso/form.iso.tpl.html#L51

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those fields aren't required though?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, disk is though. Took me a while

@asfgit
Copy link
Contributor

asfgit commented Sep 21, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR-trafficops-test/252/

@asfgit
Copy link
Contributor

asfgit commented Sep 22, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR/307/

@apache apache deleted a comment from asfgit Sep 22, 2017
@apache apache deleted a comment from asfgit Sep 22, 2017
@apache apache deleted a comment from asfgit Sep 22, 2017
@asfgit
Copy link
Contributor

asfgit commented Sep 22, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR/308/


return $self->success( $response, "Generate ISO was successful." );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this change is a problem. you can't just return the response hash you have to wrap it in a 200 which the success method does

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or wait, nm, i see on line 83 you are doing it

return $self->success( $response, "Generate ISO was successful." );

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitchell852 mitchell852 merged commit 0162aad into apache:master Sep 22, 2017
@asfgit
Copy link
Contributor

asfgit commented Sep 22, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR-trafficops-test/266/

@asfgit
Copy link
Contributor

asfgit commented Sep 22, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/incubator-trafficcontrol-PR-trafficops-test/267/

@mitchell852 mitchell852 self-assigned this Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Traffic Ops related to Traffic Ops Traffic Portal v1 related to Traffic Portal version 1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants