Merge lp:~verterok/ubuntuone-client/fix-452682-stable into lp:ubuntuone-client

Proposed by Guillermo Gonzalez
Status: Rejected
Rejected by: Guillermo Gonzalez
Proposed branch: lp:~verterok/ubuntuone-client/fix-452682-stable
Merge into: lp:ubuntuone-client
Diff against target: 92 lines (+42/-0) (has conflicts)
3 files modified
tests/syncdaemon/test_sync.py (+25/-0)
tests/syncdaemon/test_vm.py (+13/-0)
ubuntuone/syncdaemon/volume_manager.py (+4/-0)
Text conflict in tests/syncdaemon/test_sync.py
Contents conflict in ubuntuone/syncdaemon/u1fsfsm.ods
To merge this branch: bzr merge lp:~verterok/ubuntuone-client/fix-452682-stable
Reviewer Review Type Date Requested Status
Roman Yepishev (community) Needs Fixing
Joshua Hoover (community) ran branch and verified fix Approve
Review via email: mp+25558@code.launchpad.net

Commit message

Fix 'Shared With Me' symlink if the target was changed and the link is broken.

Description of the change

Fix 'Shared With Me' symlink if the target was changed and the link is broken.

To post a comment you must log in.
Revision history for this message
Joshua Hoover (joshuahoover) wrote :

Passed test in bug #452682.

review: Approve (ran branch and verified fix)
Revision history for this message
Roman Yepishev (rye) wrote :

Patched local stable install and tested it - works fine.

review: Approve
Revision history for this message
Roman Yepishev (rye) wrote :

But I believe the branch should be updated first to get rid of conflicts

review: Needs Fixing
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Hi Roman, I made a mistake while doing the merge proposal, the branch should target stable-1-2 instead of trunk, I'll submit a new merge proposal

Thanks!

Unmerged revisions

509. By Guillermo Gonzalez

check if the symlink target is the shares dir instead if it exists.

508. By Guillermo Gonzalez

fix 'Shared With Me' symlink if the target is deleted/changed and is broken.

507. By Facundo Batista

Support FS_FILE_CREATE while having the file in LOCAL.

506. By dobey

[backport] r508
Use the correct MODAL flag to avoid AttributeError
Use a try/finally to destroy the dialog when closed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/ubuntuone-preferences'
2=== modified file 'tests/syncdaemon/test_sync.py'
3--- tests/syncdaemon/test_sync.py 2010-05-11 20:40:47 +0000
4+++ tests/syncdaemon/test_sync.py 2010-05-18 19:48:27 +0000
5@@ -268,6 +268,7 @@
6 sync.handle_AQ_DOWNLOAD_DOES_NOT_EXIST(**kwargs)
7 self.assertTrue(self.called, 'nothing was called')
8
9+<<<<<<< TREE
10 def test_handle_FILE_CREATE_while_LOCAL(self):
11 """A FS_FILE_CREATE is received with the node in LOCAL."""
12 sync = Sync(main=self.main)
13@@ -315,6 +316,30 @@
14
15
16 class SyncStateMachineRunnerTestCase(BaseSync):
17+=======
18+ def test_handle_FILE_CREATE_while_LOCAL(self):
19+ """A FS_FILE_CREATE is received with the node in LOCAL."""
20+ sync = Sync(main=self.main)
21+ self.called = False
22+
23+ def faked_nothing(ssmr, event, params, *args):
24+ """Wrap SSMR.nothing to test."""
25+ self.called = True
26+ SyncStateMachineRunner.nothing = faked_nothing
27+
28+ # create a file and put it in local
29+ fsm = self.main.fs
30+ somepath = os.path.join(self.root, 'somepath')
31+ mdid = fsm.create(somepath, '')
32+ fsm.set_by_mdid(mdid, local_hash='somehash')
33+
34+ # send the event, and check that it called its .nothing()
35+ sync.handle_FS_FILE_CREATE(somepath)
36+ self.assertTrue(self.called)
37+
38+
39+class SyncStateMachineRunnerTestCase(BaseTwistedTestCase):
40+>>>>>>> MERGE-SOURCE
41 """Tests for the SyncStateMachineRunner."""
42
43 def setUp(self):
44
45=== modified file 'tests/syncdaemon/test_vm.py'
46--- tests/syncdaemon/test_vm.py 2010-04-07 13:56:56 +0000
47+++ tests/syncdaemon/test_vm.py 2010-05-18 19:48:27 +0000
48@@ -1759,6 +1759,7 @@
49 self.assertEquals(result[0], udf_path)
50 self.assertEquals(result[1], "UDFs can not be a symlink")
51
52+
53 class MetadataTestCase(BaseTwistedTestCase):
54 md_version_None = False
55 main = None
56@@ -2649,6 +2650,18 @@
57 self.assertTrue(isinstance(share, _Share))
58 self.assertTrue(isinstance(old_share, _Share))
59
60+ def test_broken_symlink_latest_metadata(self):
61+ """Test vm startup with latest metadata and a broken symlink."""
62+ self._build_layout_version_4()
63+ os.unlink(self.shares_dir_link)
64+ # create a broken link
65+ os.symlink('foo', self.shares_dir_link)
66+ # we want to keep a refernece to main in order to shutdown
67+ # pylint: disable-msg=W0201
68+ self.main = FakeMain(self.root_dir, self.shares_dir,
69+ self.data_dir, self.partials_dir)
70+ self.check_version()
71+
72
73 class BrokenOldMDVersionUpgradeTests(MetadataOldLayoutTests):
74 """MetadataOldLayoutTests with broken .version file."""
75
76=== renamed file 'ubuntuone/syncdaemon/u1fsfsm.ods' => 'ubuntuone/syncdaemon/u1fsfsm.ods.OTHER'
77Binary files ubuntuone/syncdaemon/u1fsfsm.ods 2010-05-06 18:07:50 +0000 and ubuntuone/syncdaemon/u1fsfsm.ods.OTHER 2010-05-18 19:48:27 +0000 differ
78=== modified file 'ubuntuone/syncdaemon/u1fsfsm.py'
79=== modified file 'ubuntuone/syncdaemon/volume_manager.py'
80--- ubuntuone/syncdaemon/volume_manager.py 2010-04-07 13:56:56 +0000
81+++ ubuntuone/syncdaemon/volume_manager.py 2010-05-18 19:48:27 +0000
82@@ -309,6 +309,10 @@
83 if not os.path.exists(self.m.shares_dir_link):
84 self.log.debug('creating Shares symlink: %r -> %r',
85 self.m.shares_dir_link, self.m.shares_dir)
86+ # remove the symlink if it's broken
87+ if os.path.islink(self.m.shares_dir_link) and \
88+ not os.path.exists(os.readlink(self.m.shares_dir_link)):
89+ os.remove(self.m.shares_dir_link)
90 os.symlink(self.m.shares_dir, self.m.shares_dir_link)
91 # make the shares_dir read only
92 os.chmod(self.m.shares_dir, 0555)

Subscribers

People subscribed via source and target branches