~ubuntu-branches/ubuntu/vivid/openstack-trove/vivid

« back to all changes in this revision

Viewing changes to trove/guestagent/strategies/backup/couchbase_impl.py

  • Committer: Package Import Robot
  • Author(s): Corey Bryant, Chuck Short, Corey Bryant
  • Date: 2015-01-06 13:39:46 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20150106133946-fqecrqyhzcw5nj0i
Tags: 2015.1~b1-0ubuntu1
[ Chuck Short ]
* Open up for vivid.
* debian/control: Update bzr branches. 

[ Corey Bryant ]
* New upstream release.
  - d/control: Align requirements with upstream.
  - d/watch: Update uversionmangle for kilo beta naming.
  - d/p/fix-requirements: Align requirements with Ubuntu.
* d/control: Bumped Standards-Version to 3.9.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
                                   shell=True, timeout=300)
60
60
 
61
61
    def _backup(self, password):
62
 
        utils.execute_with_timeout(['/opt/couchbase/bin/cbbackup',
63
 
                                    system.COUCHBASE_REST_API,
64
 
                                    system.COUCHBASE_DUMP_DIR,
65
 
                                    '-u', 'root', '-p', password],
 
62
        utils.execute_with_timeout('/opt/couchbase/bin/cbbackup',
 
63
                                   system.COUCHBASE_REST_API,
 
64
                                   system.COUCHBASE_DUMP_DIR,
 
65
                                   '-u', 'root', '-p', password,
66
66
                                   timeout=600)
67
67
 
68
68
    def _run_pre_backup(self):
69
69
        try:
70
70
            for cmd in self.pre_backup_commands:
71
 
                utils.execute_with_timeout(cmd)
 
71
                utils.execute_with_timeout(*cmd)
72
72
            root = service.CouchbaseRootAccess()
73
73
            pw = root.get_password()
74
74
            self._save_buckets_config(pw)
87
87
                    else:
88
88
                        LOG.info(_("All buckets are memcached.  "
89
89
                                   "Skipping backup."))
90
 
            utils.execute_with_timeout(['mv', OUTFILE,
91
 
                                        system.COUCHBASE_DUMP_DIR])
 
90
            utils.execute_with_timeout('mv', OUTFILE,
 
91
                                       system.COUCHBASE_DUMP_DIR)
92
92
            if pw != "password":
93
93
                # Not default password, backup generated root password
94
 
                utils.execute_with_timeout(['cp', '-p',
95
 
                                            system.pwd_file,
96
 
                                            system.COUCHBASE_DUMP_DIR],
 
94
                utils.execute_with_timeout('cp', '-p',
 
95
                                           system.pwd_file,
 
96
                                           system.COUCHBASE_DUMP_DIR,
97
97
                                           run_as_root=True,
98
98
                                           root_helper='sudo')
99
99
        except exception.ProcessExecutionError as p:
103
103
    def _run_post_backup(self):
104
104
        try:
105
105
            for cmd in self.post_backup_commands:
106
 
                utils.execute_with_timeout(cmd)
 
106
                utils.execute_with_timeout(*cmd)
107
107
        except exception.ProcessExecutionError as p:
108
108
            LOG.error(p)
109
109
            raise p