Skip to content

Validating type parameter and including all types#4412

Merged
DaanHoogland merged 1 commit intoapache:4.14from
shapeblue:validate-nw-type
Oct 21, 2020
Merged

Validating type parameter and including all types#4412
DaanHoogland merged 1 commit intoapache:4.14from
shapeblue:validate-nw-type

Conversation

@davidjumani
Copy link
Copy Markdown
Contributor

Description

Validating the type parameter for the listNetworks API.
Also allowing all type to be passed

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

How Has This Been Tested?

(localhost) 🐱 > list networks type=usolated
🙈 Error: (HTTP 431, error code 4350) Unexpected Guest type : usolated
list networks type=all

(localhost) 🐱 > list networks type=all filter=name
{
............
}

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

Copy link
Copy Markdown
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

not sure why we need the "all" but code looks good

Comment on lines +105 to +111
if (!Strings.isNullOrEmpty(guestIpType)) {
if (guestIpType.equalsIgnoreCase("all")) {
return null;
}
return Network.GuestType.fromValue(guestIpType).toString();
}
return null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

so in the end empty and "all" are treated the same?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

that's right!

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔centos7 ✖centos8 ✔debian. JID-2205

@davidjumani
Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

Copy link
Copy Markdown
Member

@GabrielBrascher GabrielBrascher left a comment

Choose a reason for hiding this comment

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

Code LGTM.

I have not much clue on why we need "all" @DaanHoogland. What about simply remove "all" and document it? (maybe on another PR, this would require some discussion)

@davidjumani
Copy link
Copy Markdown
Contributor Author

I think that all should be there as a filter. Will be useful in Primate to simplify the existing code once merged

@DaanHoogland
Copy link
Copy Markdown
Contributor

I'm fine with leaving it there

@davidjumani davidjumani added this to the 4.15.0.0 milestone Oct 20, 2020
@DaanHoogland DaanHoogland modified the milestones: 4.15.0.0, 4.14.1.0 Oct 20, 2020
@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3024)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32269 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4412-t3024-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_ssvm.py
Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
Smoke tests completed. 83 look OK, 0 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File

@DaanHoogland DaanHoogland merged commit 15954fe into apache:4.14 Oct 21, 2020
@DaanHoogland DaanHoogland deleted the validate-nw-type branch October 21, 2020 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants