[PC-BSD Commits] r17372 - pcbsd/current/src-qt4/warden-gui

svn at pcbsd.org svn at pcbsd.org
Thu Jun 21 09:15:50 PDT 2012


Author: kris
Date: 2012-06-21 16:15:49 +0000 (Thu, 21 Jun 2012)
New Revision: 17372

Modified:
   pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp
Log:

Fix the warden GUI showing jails with new meta system



Modified: pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp
===================================================================
--- pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp	2012-06-21 16:01:26 UTC (rev 17371)
+++ pcbsd/current/src-qt4/warden-gui/dialogwarden.cpp	2012-06-21 16:15:49 UTC (rev 17372)
@@ -114,7 +114,8 @@
    
    // Check our JailDir and see what we have
    QDir d(JailDir);
-   d.setFilter( QDir::Dirs);
+   d.setFilter(QDir::Dirs | QDir::Hidden);
+   d.setNameFilters(QStringList() << ".*.meta");
 
    // Start mount cmd
    QProcess m;
@@ -140,24 +141,36 @@
        for (int z = 0; z < mountOut.size(); ++z)
 	  if ( mountOut.at(z).indexOf("on " + JailDir + "/" + d[i]) != -1 && mountOut.at(z).indexOf("(zfs,") != -1 )
              jZFS="YES";
+
+       qDebug() << "Checking:" << d[i];
 	   
+       // Check for the IP of this jail
+       QFile fileIP( JailDir + "/" + d[i] + "/ip" );
+       if ( ! fileIP.exists() )
+          continue;
+       if ( ! fileIP.open( QIODevice::ReadOnly ) )
+          continue;
+       QTextStream streamip( &fileIP );
+       QString jIP;
+       while ( !streamip.atEnd() )
+          jIP = streamip.readLine(); // line of text excluding '\n'
+       fileIP.close();
+
        // Check for the hostname of this jail
-       QFile file( JailDir + "/" + d[i] + "/etc/warden/host" );
+       QFile file( JailDir + "/" + d[i] + "/host" );
        if ( ! file.exists() )
           continue;
        if ( ! file.open( QIODevice::ReadOnly ) )
           continue;
-
        QTextStream stream( &file );
        QString host;
-        
        while ( !stream.atEnd() )
           host = stream.readLine(); // line of text excluding '\n'
        file.close();
 	    
        // Check for additional IPs in this jail
        jIPs = "";
-       QFile fileip(JailDir + "/" + d[i] + "/etc/warden/ip-extra" );
+       QFile fileip(JailDir + "/" + d[i] + "/ip-extra" );
        if ( fileip.exists() ) {
          if (fileip.open( QIODevice::ReadOnly ) ) {
             QTextStream stream2( &fileip );
@@ -169,20 +182,20 @@
 
        // Check the type of jail
        jType = tr("Standard");
-       QFile file3(JailDir + "/" + d[i] + "/etc/warden/xjail" );
+       QFile file3(JailDir + "/" + d[i] + "/xjail" );
        if ( file3.exists() )
          jType = tr("X Jail");
 
        // Display the jail in the tree widget now
        QStringList cols;
-       cols << d[i] << d[i] << host;
+       cols << jIP << jIP << host;
 
        QTreeWidgetItem *curItem = new QTreeWidgetItem( listJails, cols );
        if ( ! listJails->currentItem() )
          listJails->setCurrentItem(curItem);
 
        // Save additional jail details into list
-       jD << d[i] << "Pending" << jType << jIPs << "" << "" << "" << jZFS;
+       jD << jIP << "Pending" << jType << jIPs << "" << "" << "" << jZFS;
        jailDetails << jD;
    
    } // end of loop
@@ -261,7 +274,7 @@
 
     // Check for additional IPs in this jail
     QString jIPs;
-    QFile fileip(JailDir + "/" + currentDetailsWorkingJail + "/etc/warden/ip-extra" );
+    QFile fileip(JailDir + "/." + currentDetailsWorkingJail + ".meta/ip-extra" );
     if ( fileip.exists() ) {
       if (fileip.open( QIODevice::ReadOnly ) ) {
          QTextStream stream2( &fileip );
@@ -1245,7 +1258,7 @@
    groupJailTab->setEnabled(true);
 
    QString AutoStart = "Disabled";
-   QFile file2(JailDir + "/" + listJails->currentItem()->text(0) + "/etc/warden/autostart" );
+   QFile file2(JailDir + "/." + listJails->currentItem()->text(0) + ".meta/autostart" );
    if ( file2.exists() )
       AutoStart = "Enabled";
    labelStartAtBoot->setText(AutoStart);



More information about the Commits mailing list