1
0
mirror of https://github.com/rancher/os.git synced 2025-06-28 15:56:58 +00:00

Fix --private flag for 'ros config export'

This commit is contained in:
Josh Curl 2016-05-31 18:10:56 -07:00
parent 410dfbe0fd
commit a59ec33787
No known key found for this signature in database
GPG Key ID: 82B504B9BCCFA677
2 changed files with 19 additions and 1 deletions

View File

@ -85,7 +85,7 @@ func Merge(bytes []byte) error {
func Export(private, full bool) (string, error) {
rawCfg, err := LoadRawConfig(full)
if private {
if !private {
rawCfg = filterPrivateKeys(rawCfg)
}

View File

@ -83,3 +83,21 @@ if [ "$(sudo ros config get rancher.network.dns.search)" == "[]
exit 1
fi
'''.strip())
def test_ros_export(qemu):
SSH(qemu).check_call('''
set -x -e
if sudo ros config export | grep "PRIVATE KEY"; then
exit 1
fi
sudo ros config export --private | grep "PRIVATE KEY"
sudo ros config export --full | grep "udev"
sudo ros config export --private --full | grep "ntp"
sudo ros config export --full | grep "labels"
sudo ros config export --private --full | grep "PRIVATE KEY"
'''.strip())