You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by "Dies Koper (JIRA)" <ji...@apache.org> on 2012/10/08 03:56:02 UTC

[jira] [Created] (DTACLOUD-337) return empty array instead of error when resource not found

Dies Koper created DTACLOUD-337:
-----------------------------------

             Summary: return empty array instead of error when resource not found
                 Key: DTACLOUD-337
                 URL: https://issues.apache.org/jira/browse/DTACLOUD-337
             Project: DeltaCloud
          Issue Type: Improvement
          Components: Server
         Environment: latest workspace, fgcp driver
            Reporter: Dies Koper
            Priority: Minor
         Attachments: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch

Making fgcp driver comply with what mfojtik said in an e-mail to the ML on 26/07/2012:

While I working on driver unit tests, I discovered that different drivers
use different ways how to return data. For example in EC2, when you query
for 'non-existing' resource (like instance), an Exception is being raised
whereas in Mock driver, the method just return empty array or 'nil'.

I think it would be great to have this unified across all driver, before
we start advertising the new Library code.

So I took the 'Mock' driver as an example, mean that:

driver.instance(:id => 'unknown') => nil
driver.instances(:id => 'unknown') => []

I think this behavior is more easy to understand that capturing different
kinds of exceptions.


--
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

[jira] [Commented] (DTACLOUD-337) return empty array instead of error when resource not found

Posted by "Marios Andreou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DTACLOUD-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13471515#comment-13471515 ] 

Marios Andreou commented on DTACLOUD-337:
-----------------------------------------

Hi Dies - after our conversation on irc with michal - can you revise the patch. I believe Michal's original comments are correct (i.e. as in the issue report above). Return nil for a single item and an empty array for the plural case.

thanks, marios
                
> return empty array instead of error when resource not found
> -----------------------------------------------------------
>
>                 Key: DTACLOUD-337
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-337
>             Project: DeltaCloud
>          Issue Type: Improvement
>          Components: Server
>         Environment: latest workspace, fgcp driver
>            Reporter: Dies Koper
>            Assignee: Marios Andreou
>            Priority: Minor
>         Attachments: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch
>
>
> Making fgcp driver comply with what mfojtik said in an e-mail to the ML on 26/07/2012:
> While I working on driver unit tests, I discovered that different drivers
> use different ways how to return data. For example in EC2, when you query
> for 'non-existing' resource (like instance), an Exception is being raised
> whereas in Mock driver, the method just return empty array or 'nil'.
> I think it would be great to have this unified across all driver, before
> we start advertising the new Library code.
> So I took the 'Mock' driver as an example, mean that:
> driver.instance(:id => 'unknown') => nil
> driver.instances(:id => 'unknown') => []
> I think this behavior is more easy to understand that capturing different
> kinds of exceptions.

--
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

[jira] [Assigned] (DTACLOUD-337) return empty array instead of error when resource not found

Posted by "Marios Andreou (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DTACLOUD-337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marios Andreou reassigned DTACLOUD-337:
---------------------------------------

    Assignee: Marios Andreou
    
> return empty array instead of error when resource not found
> -----------------------------------------------------------
>
>                 Key: DTACLOUD-337
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-337
>             Project: DeltaCloud
>          Issue Type: Improvement
>          Components: Server
>         Environment: latest workspace, fgcp driver
>            Reporter: Dies Koper
>            Assignee: Marios Andreou
>            Priority: Minor
>         Attachments: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch
>
>
> Making fgcp driver comply with what mfojtik said in an e-mail to the ML on 26/07/2012:
> While I working on driver unit tests, I discovered that different drivers
> use different ways how to return data. For example in EC2, when you query
> for 'non-existing' resource (like instance), an Exception is being raised
> whereas in Mock driver, the method just return empty array or 'nil'.
> I think it would be great to have this unified across all driver, before
> we start advertising the new Library code.
> So I took the 'Mock' driver as an example, mean that:
> driver.instance(:id => 'unknown') => nil
> driver.instances(:id => 'unknown') => []
> I think this behavior is more easy to understand that capturing different
> kinds of exceptions.

--
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

[jira] [Resolved] (DTACLOUD-337) return empty array instead of error when resource not found

Posted by "Marios Andreou (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DTACLOUD-337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marios Andreou resolved DTACLOUD-337.
-------------------------------------

    Resolution: Fixed
    
> return empty array instead of error when resource not found
> -----------------------------------------------------------
>
>                 Key: DTACLOUD-337
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-337
>             Project: DeltaCloud
>          Issue Type: Improvement
>          Components: Server
>         Environment: latest workspace, fgcp driver
>            Reporter: Dies Koper
>            Assignee: Marios Andreou
>            Priority: Minor
>         Attachments: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch, 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch
>
>
> Making fgcp driver comply with what mfojtik said in an e-mail to the ML on 26/07/2012:
> While I working on driver unit tests, I discovered that different drivers
> use different ways how to return data. For example in EC2, when you query
> for 'non-existing' resource (like instance), an Exception is being raised
> whereas in Mock driver, the method just return empty array or 'nil'.
> I think it would be great to have this unified across all driver, before
> we start advertising the new Library code.
> So I took the 'Mock' driver as an example, mean that:
> driver.instance(:id => 'unknown') => nil
> driver.instances(:id => 'unknown') => []
> I think this behavior is more easy to understand that capturing different
> kinds of exceptions.

--
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

[jira] [Closed] (DTACLOUD-337) return empty array instead of error when resource not found

Posted by "Marios Andreou (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DTACLOUD-337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marios Andreou closed DTACLOUD-337.
-----------------------------------

    
> return empty array instead of error when resource not found
> -----------------------------------------------------------
>
>                 Key: DTACLOUD-337
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-337
>             Project: DeltaCloud
>          Issue Type: Improvement
>          Components: Server
>         Environment: latest workspace, fgcp driver
>            Reporter: Dies Koper
>            Assignee: Marios Andreou
>            Priority: Minor
>         Attachments: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch, 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch
>
>
> Making fgcp driver comply with what mfojtik said in an e-mail to the ML on 26/07/2012:
> While I working on driver unit tests, I discovered that different drivers
> use different ways how to return data. For example in EC2, when you query
> for 'non-existing' resource (like instance), an Exception is being raised
> whereas in Mock driver, the method just return empty array or 'nil'.
> I think it would be great to have this unified across all driver, before
> we start advertising the new Library code.
> So I took the 'Mock' driver as an example, mean that:
> driver.instance(:id => 'unknown') => nil
> driver.instances(:id => 'unknown') => []
> I think this behavior is more easy to understand that capturing different
> kinds of exceptions.

--
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

[jira] [Commented] (DTACLOUD-337) return empty array instead of error when resource not found

Posted by "Marios Andreou (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DTACLOUD-337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472239#comment-13472239 ] 

Marios Andreou commented on DTACLOUD-337:
-----------------------------------------

ack - pushed as commit #ab8a476b290a3d6033af1411a3aca78336981de5
                
> return empty array instead of error when resource not found
> -----------------------------------------------------------
>
>                 Key: DTACLOUD-337
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-337
>             Project: DeltaCloud
>          Issue Type: Improvement
>          Components: Server
>         Environment: latest workspace, fgcp driver
>            Reporter: Dies Koper
>            Assignee: Marios Andreou
>            Priority: Minor
>         Attachments: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch, 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch
>
>
> Making fgcp driver comply with what mfojtik said in an e-mail to the ML on 26/07/2012:
> While I working on driver unit tests, I discovered that different drivers
> use different ways how to return data. For example in EC2, when you query
> for 'non-existing' resource (like instance), an Exception is being raised
> whereas in Mock driver, the method just return empty array or 'nil'.
> I think it would be great to have this unified across all driver, before
> we start advertising the new Library code.
> So I took the 'Mock' driver as an example, mean that:
> driver.instance(:id => 'unknown') => nil
> driver.instances(:id => 'unknown') => []
> I think this behavior is more easy to understand that capturing different
> kinds of exceptions.

--
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

[jira] [Updated] (DTACLOUD-337) return empty array instead of error when resource not found

Posted by "Dies Koper (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DTACLOUD-337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dies Koper updated DTACLOUD-337:
--------------------------------

    Attachment: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch

catches the exceptions and returns [] instead
                
> return empty array instead of error when resource not found
> -----------------------------------------------------------
>
>                 Key: DTACLOUD-337
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-337
>             Project: DeltaCloud
>          Issue Type: Improvement
>          Components: Server
>         Environment: latest workspace, fgcp driver
>            Reporter: Dies Koper
>            Priority: Minor
>         Attachments: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch
>
>
> Making fgcp driver comply with what mfojtik said in an e-mail to the ML on 26/07/2012:
> While I working on driver unit tests, I discovered that different drivers
> use different ways how to return data. For example in EC2, when you query
> for 'non-existing' resource (like instance), an Exception is being raised
> whereas in Mock driver, the method just return empty array or 'nil'.
> I think it would be great to have this unified across all driver, before
> we start advertising the new Library code.
> So I took the 'Mock' driver as an example, mean that:
> driver.instance(:id => 'unknown') => nil
> driver.instances(:id => 'unknown') => []
> I think this behavior is more easy to understand that capturing different
> kinds of exceptions.

--
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

[jira] [Updated] (DTACLOUD-337) return empty array instead of error when resource not found

Posted by "Dies Koper (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DTACLOUD-337?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dies Koper updated DTACLOUD-337:
--------------------------------

    Attachment: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch

renamed /VALIDATION_ERROR.*/ to /RESOURCE_NOT_FOUND/ in firewalls
                
> return empty array instead of error when resource not found
> -----------------------------------------------------------
>
>                 Key: DTACLOUD-337
>                 URL: https://issues.apache.org/jira/browse/DTACLOUD-337
>             Project: DeltaCloud
>          Issue Type: Improvement
>          Components: Server
>         Environment: latest workspace, fgcp driver
>            Reporter: Dies Koper
>            Assignee: Marios Andreou
>            Priority: Minor
>         Attachments: 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch, 0001-FGCP-return-empty-array-instead-of-error-when-no-dat.patch
>
>
> Making fgcp driver comply with what mfojtik said in an e-mail to the ML on 26/07/2012:
> While I working on driver unit tests, I discovered that different drivers
> use different ways how to return data. For example in EC2, when you query
> for 'non-existing' resource (like instance), an Exception is being raised
> whereas in Mock driver, the method just return empty array or 'nil'.
> I think it would be great to have this unified across all driver, before
> we start advertising the new Library code.
> So I took the 'Mock' driver as an example, mean that:
> driver.instance(:id => 'unknown') => nil
> driver.instances(:id => 'unknown') => []
> I think this behavior is more easy to understand that capturing different
> kinds of exceptions.

--
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