← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1295426] Re: "get console output" v3 API should allow "null" as the length

 

** Project changed: python-novaclient => nova

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1295426

Title:
  "get console output" v3 API should allow "null" as the length

Status in OpenStack Compute (Nova):
  In Progress

Bug description:
  If running "nova console-log" command against v3 API, the command
  fails like the following:

  $ nova --os-compute-api-version 3 console-log vm01
  ERROR: Invalid input for field/attribute length. Value: None. None is not of type 'integer', 'string' (HTTP 400) (Request-ID: req-b8588c9b-58a7-4e22-a2e9-30c5354ae4f7)
  $

  This is because API schema of the API does not allow null as the length of log.
  However, get_console_output() of nova-compute allows null by the following code:

  3942     def get_console_output(self, context, instance, tail_length):
  3943         """Send the console output for the given instance."""
  3944         instance = instance_obj.Instance._from_db_object(
  3945             context, instance_obj.Instance(), instance)
  3946         context = context.elevated()
  3947         LOG.audit(_("Get console output"), context=context,
  3948                   instance=instance)
  3949         output = self.driver.get_console_output(context, instance)
  3950
  3951         if tail_length is not None:
  3952             output = self._tail_log(output, tail_length)
  3953
  3954         return output.decode('utf-8', 'replace').encode('ascii', 'replace')

  So the API also should allow it.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1295426/+subscriptions


References