Selaa lähdekoodia

[core] Trash enabled info is wrong

Romain Rigaux 12 vuotta sitten
vanhempi
commit
f0f6c14

+ 1 - 1
apps/about/src/about/templates/admin_wizard.mako

@@ -66,7 +66,7 @@ ${ header.menubar() }
             <h2 class="card-heading simple">${ _('HDFS Trash Configuration') }</h2>
           <div class="card-body">
           <p>
-            % if not trash_enabled:
+            % if trash_enabled:
             <h5>${ _('Trash is active.')}</h5>
             % else:
             ${ _('You can activate trash collection by setting fs.trash.interval in core-site.xml:')}<br/><br/>

+ 4 - 5
apps/about/src/about/views.py

@@ -15,10 +15,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-try:
-  import json
-except ImportError:
-  import simplejson as json
+
+import json
 
 from django.conf import settings
 from django.http import HttpResponse
@@ -36,13 +34,14 @@ def admin_wizard(request):
   app_names = [app.name for app in sorted(apps, key=lambda app: app.menu_index)]
 
   tours_and_tutorials = Settings.get_settings().tours_and_tutorials
+  trash_enabled = get_trash_interval() > 0
 
   return render('admin_wizard.mako', request, {
       'version': settings.HUE_DESKTOP_VERSION,
       'apps': dict([(app.name, app) for app in apps]),
       'app_names': app_names,
       'tours_and_tutorials': tours_and_tutorials,
-      'trash_enabled': get_trash_interval()
+      'trash_enabled': trash_enabled
   })
 
 

+ 1 - 1
desktop/libs/hadoop/src/hadoop/core_site.py

@@ -75,4 +75,4 @@ def get_trash_interval():
 
   Also indicates whether trash is enabled or not.
   """
-  return get_conf().get(_CNF_TRASH_INTERVAL, None)
+  return get_conf().get(_CNF_TRASH_INTERVAL, None)