Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev_5_0: Add omero config append/remove subcommands with default value handling for omero.web.* variables #2041

Merged
merged 22 commits into from Feb 4, 2014

Conversation

knabar
Copy link
Member

@knabar knabar commented Jan 29, 2014

This PR addresses https://trac.openmicroscopy.org.uk/ome/ticket/11201

Changes included are:

  • addition of bin/omero config append and bin/omero config remove so that configuration using lists of strings can easily be manipulated, e.g.

    bin/omero config append omero.web.apps '"webfigure"'
    bin/omero config append omero.web.apps '"webtagging"'
    …
    bin/omero config remove omero.web.apps '"webfigure"'
    
  • addition of corresponding unit tests under test_prefs.py

  • loading the default value from omeroweb/settings.py when a value is appended to or removed from a previously unset omero.web.* property.

    $ omero config get omero.web.server_list
    $ omero config append omero.web.server_list '["test",123,"omtest"]'
    $ omero config get omero.web.server_list
    [["localhost", 4064, "omero"], ["test", 123, "omtest"]]
    

--rebased-from #2030

@manics
Copy link
Member

manics commented Jan 30, 2014

👍

Extract from my modified install script:

OMERO="$OMERO_SERVER/bin/omero"
TABsearcher='["Searcher", "searcher/plugin_config/right_search_form.js.html", "right_search_form"]'
WEBsearcher='"omero_searcher"'

CONFIGweb=omero.web.apps
CONFIGtab=omero.web.ui.right_plugins

if [ $CONF -eq 5 ]; then
    echo "Configuring OMERO web-apps"

    "$OMERO" config remove "$CONFIGweb" "$WEBsearcher" || true
    "$OMERO" config append "$CONFIGweb" "$WEBsearcher" || {
        echo "ERROR: Failed to configure $CONFIGweb"
        exit 2
    }

    "$OMERO" config remove "$CONFIGtab" "$TABsearcher" || true
    "$OMERO" config append "$CONFIGtab" "$TABsearcher" || {
        echo "ERROR: Failed to configure $CONFIGtab"
        exit 2
    }
fi

@manics
Copy link
Member

manics commented Jan 30, 2014

One very nit-picky comment: If there are duplicate values append adds to the end, remove takes from the beginning.

@knabar
Copy link
Member Author

knabar commented Jan 30, 2014

@manics Is there a situation where order is relevant? Should we just make remove take the first matching element from the end of the list instead of the beginning? Or do we even need to offer more control (e.g. prepend, remove-last)?

@manics
Copy link
Member

manics commented Jan 30, 2014

@knabar No, it was just a comment (c.f. the one from an earlier PR about empty vs [] being symmetric), I'm happy with the current behacviour.

@joshmoore
Copy link
Member

@will-moore / @dpwrussell : comments?

@will-moore
Copy link
Member

Looks good!

@joshmoore
Copy link
Member

Merging. Leave guidelines for reworking the CI jobs to you, @sbesson.

joshmoore added a commit that referenced this pull request Feb 4, 2014
…ev_5_0

dev_5_0: Add omero config append/remove subcommands with default value handling for omero.web.* variables
@joshmoore joshmoore merged commit 1e83cf0 into ome:dev_5_0 Feb 4, 2014
@knabar knabar deleted the feature-smart-omero-web-config-dev_5_0 branch August 7, 2019 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants