Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.4k
project id added in test#3378
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
Uh oh!
There was an error while loading. Please reload this page.
project id added in test #3378
Changes from all commits
10a29c5a39505ca4787047295623b39d3c42fcbb138462fceb47ae14e1f5f7aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1755,21 +1755,39 @@ def test_15_project_tag(self): | ||
| self.apiclient, | ||
| listall=True, | ||
| resourceType='project', | ||
| resourceIds=project.id, | ||
| projectid=project.id, | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have expected this to work without specifying project ID. Do you think we need to fix mgmt server instead? Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @DaanHoogland Read this https://github.com/apache/cloudstack/pull/3323/files, how about we add a check to read the resource type and use the provided resource ID as account ID when type is project. Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rhtyd that should be good. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, that would work, @rhtyd. I don't think it matters much, as the id is already in the API, but that solution would have less breakage of ecosystem scripting so let's go for it. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on second thought @rhtyd , you do mean to use the resource ID to get the account ID and not use it as account ID, right? (else I don't understand 😮 ) Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes @DaanHoogland, I'm more concerned with existing systems and integrations that may break. And moreover, it breaks the API semantics (we're already passing projectid in the resource ID so why not use it). ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on second thought @rhtyd , it won't work. There is no resource ID unless the project ID is passed as such. in the call there is no information that we can use We could get the current account from the call context but that would only satisfy some use-cases. if an admin wants tags for some project they are not in we still need the parameter. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. never mind, i think I was stupid just there ^^. I'll revisit. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've been mostly busy on other things today but gave it a second look. I think it can be fixed as you suggest in the query service. I will give it a swing soon. I'll remove the java change for now but leave the test in. | ||
| key=tag_key, | ||
| ) | ||
| self.debug("tags = %s" % tags) | ||
| tag2 = Tag.list( | ||
| self.apiclient, | ||
| listall=True, | ||
| resourceType='project', | ||
| resourceId=project.id, | ||
| key=tag_key, | ||
| ) | ||
| self.debug("tag2 = %s" % tags) | ||
| self.assertEqual( | ||
| isinstance(tags, list), | ||
| True, | ||
| "List tags should not return empty response" | ||
| ) | ||
| self.assertEqual( | ||
| isinstance(tag2, list), | ||
| True, | ||
| "List tags should not return empty response" | ||
| ) | ||
| self.assertEqual( | ||
| tags[0].value, | ||
| tag_value, | ||
| 'The tag should have original value' | ||
| ) | ||
| self.assertEqual( | ||
| tag2[0].value, | ||
| tag_value, | ||
| 'The tag should have original value' | ||
| ) | ||
| projects = Project.list( | ||
| self.apiclient, | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the uuid is invalid ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it throws an exception: garbage in, garbage out. should we handle that? I think it is the exception @rhtyd is pointing at. How do you suggest this should be handled?