mirror of https://github.com/docker/docs.git
remove bool argument from getDirectory
Signed-off-by: Alexandre Beslic <abronan@docker.com>
This commit is contained in:
parent
ccf6e37c16
commit
a73c89d42b
|
|
@ -104,7 +104,7 @@ func (s *Etcd) Put(key string, value []byte) error {
|
||||||
if etcdError, ok := err.(*etcd.EtcdError); ok {
|
if etcdError, ok := err.(*etcd.EtcdError); ok {
|
||||||
if etcdError.ErrorCode == 104 { // Not a directory
|
if etcdError.ErrorCode == 104 { // Not a directory
|
||||||
// Remove the last element (the actual key) and set the prefix as a dir
|
// Remove the last element (the actual key) and set the prefix as a dir
|
||||||
err = s.createDirectory(getDirectory(key, false))
|
err = s.createDirectory(getDirectory(key))
|
||||||
if _, err := s.client.Set(key, string(value), 0); err != nil {
|
if _, err := s.client.Set(key, string(value), 0); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ func normalize(key string) string {
|
||||||
//
|
//
|
||||||
// /path/to/
|
// /path/to/
|
||||||
//
|
//
|
||||||
func getDirectory(key string, omit bool) string {
|
func getDirectory(key string) string {
|
||||||
parts := splitKey(key)
|
parts := splitKey(key)
|
||||||
parts = parts[:len(parts)-1]
|
parts = parts[:len(parts)-1]
|
||||||
return "/" + join(parts)
|
return "/" + join(parts)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue