os.rename does not work with windows
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Fix Released
|
High
|
Nate Finch | ||
1.16 |
Fix Released
|
Critical
|
Nate Finch | ||
juju-core (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Saucy |
Fix Released
|
High
|
Unassigned | ||
Trusty |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
juju is broken as a client on Windows
[Test Case]
Use juju on windows; renaming of files breaks and client exits
[Regression Potential]
Although this is a bug that only impacts Windows client users, the fix impacts the way all renames are done in the client and server, so care should be taking to ensure that non-Windows environments still function (they do).
[Original Bug Report]
Turns out that os.rename works as atomic file replacement on linux, but not on Windows. There's actually no way (as far as I can tell) to atomically replace a file with another one on windows using the go code as written. Luckily, it's not hard to wrap the Windows API in go code and use that.... so that's what this code code.
Related branches
- Juju Engineering: Pending requested
-
Diff: 624 lines (+366/-52) (has conflicts)14 files modifiedcharm/repo.go (+2/-1)
cmd/plugins/juju-metadata/validateimagemetadata_test.go (+38/-0)
environs/configstore/disk.go (+1/-1)
environs/filestorage/filestorage.go (+1/-1)
environs/sync/sync.go (+10/-0)
environs/sync/sync_test.go (+26/-1)
environs/tools/simplestreams_test.go (+113/-0)
provider/maas/instance_test.go (+93/-45)
utils/file_unix.go (+15/-0)
utils/file_windows.go (+35/-0)
utils/fslock/fslock.go (+2/-2)
utils/trivial.go (+1/-1)
utils/zfile_windows.go (+25/-0)
version/version.go (+4/-0)
- Juju Engineering: Pending requested
-
Diff: 171 lines (+82/-6)8 files modifiedcharm/repo.go (+2/-1)
environs/configstore/disk.go (+1/-1)
environs/filestorage/filestorage.go (+1/-1)
utils/file_unix.go (+15/-0)
utils/file_windows.go (+35/-0)
utils/fslock/fslock.go (+2/-2)
utils/trivial.go (+1/-1)
utils/zfile_windows.go (+25/-0)
Changed in juju-core: | |
milestone: | none → 1.16.1 |
Changed in juju-core: | |
milestone: | 1.16.1 → 1.17.0 |
status: | Fix Released → In Progress |
importance: | Critical → High |
summary: |
- os.rename does not wotk with windows + os.rename does not work with windows |
Changed in juju-core: | |
status: | In Progress → Fix Committed |
description: | updated |
description: | updated |
Changed in juju-core (Ubuntu Saucy): | |
importance: | Undecided → High |
tags: |
added: verification-done removed: verification-needed |
Changed in juju-core: | |
status: | Fix Committed → Fix Released |
This bug was fixed in the package juju-core - 1.16.2-0ubuntu1
---------------
juju-core (1.16.2-0ubuntu1) trusty; urgency=low
* New upstream point release.
(LP: #1240709, #1240927, #1246320, #1246556, #1245004)
(LP: #1081247, #1229275, #1239508, #1240423, #1241666, #1243861).
-- James Page <email address hidden> Thu, 31 Oct 2013 21:22:45 +0000