(self)
Get the volume bindings string for runc
Get the volume bindings string for runc
Get the volume bindings string for runc
def _add_volume_bindings(self):
        """Get the volume bindings string for runc"""
        (host_dir, cont_dir) = self._filebind.start(Config.conf['sysdirs_list'])
        self._add_mount_spec(host_dir, cont_dir, rwmode=True)
        for vol in self.opt["vol"]:
            (host_dir, cont_dir) = Uvolume(vol).split()
            if os.path.isdir(host_dir):
                if host_dir == "/dev":
                    Msg().out("Warning: engine does not support -v",
                              host_dir, l=Msg.WAR)
                    continue
                self._add_mount_spec(host_dir, cont_dir, rwmode=True)
            elif os.path.isfile(host_dir):
                if (host_dir not in Config.conf['sysdirs_list'] and
                        host_dir + ":" + cont_dir not in self.hostauth_list and
                        os.path.dirname(cont_dir) not in
                        Config.conf['mountpoint_prefixes']):
                    Msg().err("Error: engine does not support file mounting:",
                              host_dir)
                else:
                    self._filebind.set_file(host_dir, cont_dir)
                    self._filebind.add_file(host_dir, cont_dir)
def _add_volume_bindings ( self ) : ( host_dir , cont_dir ) = self . _filebind . start ( Config . conf [ 'sysdirs_list' ] ) self . _add_mount_spec ( host_dir , cont_dir , rwmode = True ) for vol in self . opt [ "vol" ] : ( host_dir , cont_dir ) = Uvolume ( vol ) . split ( ) if os . path . isdir ( host_dir ) : if host_dir == "/dev" : Msg ( ) . out ( "Warning: engine does not support -v" , host_dir , l = Msg . WAR ) continue self . _add_mount_spec ( host_dir , cont_dir , rwmode = True ) elif os . path . isfile ( host_dir ) : if ( host_dir not in Config . conf [ 'sysdirs_list' ] and host_dir + ":" + cont_dir not in self . hostauth_list and os . path . dirname ( cont_dir ) not in Config . conf [ 'mountpoint_prefixes' ] ) : Msg ( ) . err ( "Error: engine does not support file mounting:" , host_dir ) else : self . _filebind . set_file ( host_dir , cont_dir ) self . _filebind . add_file ( host_dir , cont_dir )