Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Conversation

@kc284
Copy link

@kc284 kc284 commented May 28, 2020

See commit messages for details. Commits best reviewed separately.

Konstantina Chremmou added 4 commits May 28, 2020 00:14
- In PoSh $null should be on the left side of comparisons.
- Aliases should be avoided.
- Missing PassThru.

Signed-off-by: Konstantina Chremmou <[email protected]>
Signed-off-by: Konstantina Chremmou <[email protected]>
…n which the API call is run if the latter returns void.

Signed-off-by: Konstantina Chremmou <[email protected]>
an exposed XenAPI class. To specify the object to remove use the parameter
T, where T is the exposed XenAPI class, or Ref or, for those objects that
have a uuid or name, UUID or Name. Example:
-T, where T is the exposed XenAPI class, or -Ref or, for those objects that
Copy link
Contributor

Choose a reason for hiding this comment

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

I notice some changes around hyphens. Several symbols exist in UTF8 but not in Ascii, where we just have the minus, which is used for everything. Code that is pasted into the shell use the minus as otherwise it would not be recognised despite looking correct.

Copy link
Author

Choose a reason for hiding this comment

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

Indeed, the old "hyphens" were in reality this character in UTF-16: \u00e2\u0080\u0090. I've turned them to minus.

@kc284
Copy link
Author

kc284 commented May 28, 2020

An example in order to understand what the OCaml change does:

Previously, calling the following cmdlet: Invoke-XenVM -Name MyVm -XenAction CleanShutdown -PassThru caused the following C# code to run:

XenAPI.VM.clean_shutdown(session, vm);

if (PassThru)
{
    var obj = XenAPI.VM.get_record(session, vm);
    if (obj != null)
        obj.opaque_ref = vm;
    WriteObject(obj, true);
}

i.e. the cmdldet returns the object on which the call was called. Which is not really necessary and it doesn't work for classes without records (e.g. Diagnostics).
Now the following code will be run:

XenAPI.VM.clean_shutdown(session, vm);

if (PassThru)
    WriteWarning("-PassThru can only be used with -Async for this cmdlet. Ignoring.");

The change affects a big number of API calls returning void (they can be found by diffing the autogenerated code), but breaking user implementation may not be very likely as most users wouldn't expect a cmdlet to return the object for a call returning void.

@kc284 kc284 merged commit 6fc5817 into xapi-project:master May 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants