Skip to content

Add command to get and set config for external mounts#20710

Merged
DeepDiver1975 merged 3 commits into
masterfrom
files_external_config_command
Dec 1, 2015
Merged

Add command to get and set config for external mounts#20710
DeepDiver1975 merged 3 commits into
masterfrom
files_external_config_command

Conversation

@icewind1991

Copy link
Copy Markdown
Contributor

Usage:

usage

Currently this only works for admin configured storage due to limitations in the way we store mounts, with #20370 it can be extended to properly handle user configured mounts

cc @PVince81 @Xenopathic

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

Woah, nice! (Will review in the next few days)

@PVince81

Copy link
Copy Markdown
Contributor

@icewind1991 can you always post a link to the original ticket it is related to ?

For #20368

@PVince81

Copy link
Copy Markdown
Contributor

Looks good 👍

Comment thread apps/files_external/command/config.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be cleaner to get if there is no value passed, and set if there is a value passed, removing the need for a separate command line argument.

Proposed example usage:

./occ files_external:config 42 host #prints 'localhost'
./occ files_external:config 42 host abc.example.com #sets host

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems cleaner yes

@icewind1991 icewind1991 force-pushed the files_external_config_command branch from 219ac67 to 6ed4dcc Compare November 25, 2015 15:18
@icewind1991

Copy link
Copy Markdown
Contributor Author

Removed the get/set argument, action is now determined based on if the value is defined

@icewind1991

Copy link
Copy Markdown
Contributor Author

Also added command to set mount options occ files_external:option which is used in the same way

Comment thread apps/files_external/command/config.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The storage service will throw an exception itself if the storage cannot be found, so this block is unneeded (but it might be advisable to wrap the getStorage() in a try catch to print a better message)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@icewind1991 icewind1991 force-pushed the files_external_config_command branch from e7efbe9 to 1e1cb7a Compare November 25, 2015 15:38
Comment thread apps/files_external/command/config.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return with a non-zero code so shell scripts can detect the error

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@icewind1991 can you fix this and then I'll count @Xenopathic's LGTM as 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

LGTM so far, just one question: how can we set non-string values, e.g. integers or booleans?

@icewind1991

Copy link
Copy Markdown
Contributor Author

You can just enter them directory, bools, ints and floats are all handled correctly

@PVince81

Copy link
Copy Markdown
Contributor

@Xenopathic counts as 👍 ?

@icewind1991

Copy link
Copy Markdown
Contributor Author

@Xenopathic @DeepDiver1975 merge?

@RobinMcCorkell

Copy link
Copy Markdown
Contributor

@icewind1991 icewind1991 force-pushed the files_external_config_command branch from 1e1cb7a to 1347e33 Compare December 1, 2015 12:48
@RobinMcCorkell

Copy link
Copy Markdown
Contributor

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants