Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / zypp / media / MediaCD.cc
index bbc3d3c..8452736 100644 (file)
@@ -409,9 +409,14 @@ namespace zypp
     // This also fills the _devices list on demand
     DeviceList detected( detectDevices( _url.getScheme() == "dvd" ? true : false ) );
 
+    if( !isUseableAttachPoint( attachPoint() ) )
+    {
+      setAttachPoint( createAttachPoint(), true );
+    }
+    std::string mountpoint( attachPoint().asString() );
+
     Mount mount;
     MediaMountException merr;
-    string mountpoint = attachPoint().asString();
 
     string options = _url.getQueryParam( "mountoptions" );
     if ( options.empty() )
@@ -526,16 +531,6 @@ namespace zypp
       {
         try
         {
-          if( !isUseableAttachPoint(Pathname(mountpoint)))
-          {
-            mountpoint = createAttachPoint().asString();
-            setAttachPoint( mountpoint, true);
-            if( mountpoint.empty())
-            {
-              ZYPP_THROW( MediaBadAttachPointException(url()));
-            }
-          }
-
           mount.mount(it->name, mountpoint, *fsit, options);
 
           setMediaSource(media);
@@ -724,9 +719,9 @@ namespace zypp
   //
   //  DESCRIPTION : Asserted that media is attached.
   //
-  void MediaCD::getFile(const Pathname & filename , const ByteCount &expectedFileSize_r) const
+  void MediaCD::getFile( const Pathname & filename ) const
   {
-    MediaHandler::getFile( filename, expectedFileSize_r );
+    MediaHandler::getFile( filename );
   }
 
   ///////////////////////////////////////////////////////////////////