~townsend/libertine/release-1.2

« back to all changes in this revision

Viewing changes to python/libertine/LxcContainer.py

  • Committer: Chris Townsend
  • Author(s): Chris Townsend, Larry Price, Ted Gould
  • Date: 2016-05-05 15:04:03 UTC
  • mfrom: (94.4.123 devel)
  • mto: This revision was merged to the branch mainline in revision 126.
  • Revision ID: christopher.townsend@canonical.com-20160505150403-lt20lt1kwxm3lbg4
* Make a list of packages to install during container creation and also
  include the humanity-icon-them as one of them. (LP: #1578353)
* Add a Click package hook for handling bespoke Puritine container installs
  This handles multiple Puritine-type containers installed on the same system.
  (LP: #1576356) (LP: #1576406)
* Updating liblibertine to search local applications directory for desktop apps.
  This is to make it easier for u-a-l and ContentHub to find a complete set of
  available launchable applications.

Show diffs side-by-side

added added

removed removed

Lines of Context:
108
108
            self.stop_container()
109
109
            raise RuntimeError("Not able to connect to the network.")
110
110
 
111
 
        self.run_in_container("umount /tmp/.X11-unix")
112
 
        self.run_in_container("umount -l /usr/lib/locale")
 
111
        if self.run_in_container("mountpoint -q /tmp/.X11-unix") == 0:
 
112
            self.run_in_container("umount /tmp/.X11-unix")
 
113
        if self.run_in_container("mountpoint -q /usr/lib/locale") == 0:
 
114
            self.run_in_container("umount -l /usr/lib/locale")
113
115
 
114
116
    def stop_container(self):
115
117
        self.container.stop()
200
202
            print("Updating the contents of the container after creation...")
201
203
        self.update_packages(verbosity)
202
204
 
203
 
        if not self.install_package("software-properties-common", verbosity):
204
 
            print("Failure installing software-properties-common during container creation")
205
 
            self.destroy_libertine_container()
206
 
            return False
207
 
 
208
 
        if verbosity == 1:
209
 
            print("Installing Matchbox as the Xmir window manager...")
210
 
        if not self.install_package('matchbox', verbosity=verbosity):
211
 
            print("Failure installing matchbox during container creation")
212
 
            self.destroy_libertine_container()
213
 
            return False
 
205
        for package in self.default_packages:
 
206
            if not self.install_package(package, verbosity):
 
207
                print("Failure installing %s during container creation" % package)
 
208
                self.destroy_libertine_container()
 
209
                return False
214
210
 
215
211
        if verbosity == 1:
216
212
            print("stopping container ...")
297
293
        message = "stop " + self.container_id
298
294
        libertine_lxc_mgr_sock.send(message.encode())
299
295
 
300
 
        # Receive the reply from libertine-lxc-manager (ignore it for now). 
 
296
        # Receive the reply from libertine-lxc-manager (ignore it for now).
301
297
        data = libertine_lxc_mgr_sock.recv(1024)
302
298
        libertine_lxc_mgr_sock.close()