deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michal Fojtik (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DTACLOUD-432) Using $select=disks&$expand=disks return 500
Date Mon, 28 Jan 2013 11:33:12 GMT

    [ https://issues.apache.org/jira/browse/DTACLOUD-432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564205#comment-13564205
] 

Michal Fojtik commented on DTACLOUD-432:
----------------------------------------

Yes, sorry for not spotting this. This was an extra bug in Disk model, where it used the MachineConfig
disks method to get properties (which include only 'capacity' and dropped 'format' property).

The latest http://tracker.deltacloud.org/set/277 include this fix:

 ~/code/core/server/lib/cimi ›  curl -X GET -H "accept:application/xml" --user "mockuser:mockpassword"
'http://localhost:3001/cimi/machines?$select=name,disks&$expand=disks'
<Collection xmlns="http://schemas.dmtf.org/cimi/1" resourceURI="http://schemas.dmtf.org/cimi/1/MachineCollection">
  <id>http://localhost:3001/cimi/machines</id>
  <count>2</count>
  <Machine>
    <name>MockUserInstance</name>
    <disks href="http://localhost:3001/cimi/machines/inst1/disks">
      <id>http://localhost:3001/cimi/machines/inst1/disks</id>
      <count>1</count>
      <Disk>
        <id>http://localhost:3001/cimi/machines/inst1/disks/inst1_disk_167772160</id>
        <name>inst1_disk_167772160</name>
        <description>Disk for Machine inst1</description>
        <created>2013-01-28T12:24:07+01:00</created>
        <capacity>167772160</capacity>
      </Disk>
    </disks>
  </Machine>
  <Machine>
    <name>Mock Instance With Profile Change</name>
    <disks href="http://localhost:3001/cimi/machines/inst0/disks">
      <id>http://localhost:3001/cimi/machines/inst0/disks</id>
      <count>1</count>
      <Disk>
        <id>http://localhost:3001/cimi/machines/inst0/disks/inst0_disk_891289600</id>
        <name>inst0_disk_891289600</name>
        <description>Disk for Machine inst0</description>
        <created>2013-01-28T12:24:07+01:00</created>
        <capacity>891289600</capacity>
      </Disk>
    </disks>
  </Machine>
  <operation rel="add" href="http://localhost:3001/cimi/machines" />
</Collection>

                
> Using $select=disks&$expand=disks return 500
> --------------------------------------------
>
>                 Key: DTACLOUD-432
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-432
>             Project: DeltaCloud
>          Issue Type: Bug
>            Reporter: Michal Fojtik
>            Assignee: Michal Fojtik
>
> When using this URL:
> http://localhost:3001/cimi/machines?$expand=disks&$select=disks
> I expect that only expanded disks subcollection will appear. However I get this:
> error status="500" url="/cimi/machines">
> <kind>backend_error</kind>
> <message>
> <![CDATA[undefined local variable or method `entry_name' for #<Class::DiskCollection:0x7fe03934a050>
]]>
> </message>
> <backend driver="mock">
> <code>500</code>
> </backend>
> <backtrace>
> [ Abbreviated trace pass fulltrace=1 as query param to see everything $app = /home/mfojtik/code/core/server/lib
] $app/cimi/models/collection.rb:56:in `[]' $app/cimi/models/collection.rb:27:in `initialize'
$app/cimi/models/schema.rb:266:in `new' $app/cimi/models/schema.rb:266:in `convert' $app/cimi/models/schema.rb:288:in
`convert' $app/cimi/models/base.rb:184:in `initialize' ... $app/cimi/models/base.rb:183:in
`each' $app/cimi/models/base.rb:183:in `inject' $app/cimi/models/base.rb:183:in `initialize'
$app/cimi/models/base.rb:288:in `new' $app/cimi/models/base.rb:288:in `filter_attributes'
$app/cimi/models/collection.rb:67:in `filter_attributes' $app/cimi/models/collection.rb:66:in
`map' $app/cimi/models/collection.rb:66:in `filter_attributes' $app/cimi/models/base.rb:252:in
`filter_by' $app/cimi/collections/machines.rb:27 ... $app/sinatra/rack_accept.rb:164:in `call'
... $app/sinatra/rack_accept.rb:164:in `call' ... $app/sinatra/rack_accept.rb:164:in `call'
... $app/sinatra/rack_accept.rb:164:in `call' ... $app/sinatra/rack_accept.rb:164:in `call'
... $app/sinatra/rack_accept.rb:164:in `call' ... $app/sinatra/rack_accept.rb:164:in `call'
... $app/sinatra/rack_accept.rb:164:in `call' ... $app/sinatra/rack_accept.rb:164:in `call'
... $app/sinatra/rack_accept.rb:164:in `call' ... $app/sinatra/rack_accept.rb:164:in `call'
... $app/sinatra/rack_accept.rb:164:in `call' ... $app/sinatra/rack_accept.rb:164:in `call'
... $app/sinatra/rack_driver_select.rb:45:in `call' $app/sinatra/rack_matrix_params.rb:104:in
`call' $app/sinatra/rack_etag.rb:41:in `call' $app/sinatra/rack_date.rb:31:in `call' $app/sinatra/rack_logger.rb:76:in
`call' $app/sinatra/rack_accept.rb:164:in `call' ... $app/sinatra/rack_matrix_params.rb:104:in
`call' ...
> </backtrace>
> </error>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message