"openstack dataprocessing plugin configs get" misses errors

Bug #1625990 reported by Luigi Toscano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Python client library for Sahara
Fix Released
High
Shu Yingya

Bug Description

The command
openstack dataprocessing plugin configs get <plugin> <version>
does not return an error if the file where the output should be written already exists.

Moreover, the output file only use the plugin name and not the version, with a higher risk of collisions.

The return code should be changes so that it is different than 0 when the file already exists. I would like to propose also, even if I'm not sure as this is a behavioral change, that the default behavior should be changed to "write to stdout" as usual for many tools, instead of a file.

Changed in python-saharaclient:
importance: Undecided → High
Revision history for this message
Vitalii Gridnev (vgridnev) wrote :

So, actually there is a option --file that allows user to override file to save plugin configs, but I think that we can improve current implementation to address this issue.

About writing to stdout, I'm not quite sure it's ok, just because size of configs is around 2MB.

Changed in python-saharaclient:
status: New → Triaged
Shu Yingya (felixshu)
Changed in python-saharaclient:
assignee: nobody → Shu Yingya (felixshu)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-saharaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/376028

Changed in python-saharaclient:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-saharaclient (master)

Reviewed: https://review.openstack.org/376028
Committed: https://git.openstack.org/cgit/openstack/python-saharaclient/commit/?id=82cabbd3c9e3fe7b310a086a03a4c0730ccd148d
Submitter: Jenkins
Branch: master

commit 82cabbd3c9e3fe7b310a086a03a4c0730ccd148d
Author: Shu Yingya <email address hidden>
Date: Sun Sep 25 23:58:38 2016 +0800

    Raise exception in command "plugin configs get"

    In this patch, there are three changes.
    1. Raise Exception if the config file already exists.
    2. Avoid overriding the file of different version of a plugin.
    3. stdout message should end with '\n' to start a newline.
    4. execute remote API call only when file not exists.

    Change-Id: I0c9eb2cb7fd1cafe4bea05c73811d6dea6b3e9a8
    Closes-Bug: 1625990

Changed in python-saharaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-saharaclient 1.0.0

This issue was fixed in the openstack/python-saharaclient 1.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.