Revision bf926504 snf-cyclades-app/synnefo/ui/static/snf/js/neutron.js

b/snf-cyclades-app/synnefo/ui/static/snf/js/neutron.js
406 406
          if (!synnefo.config.hotplug_enabled && this.get('vm') && vm_active) {
407 407
            return false;
408 408
          }
409
          if (this.get('device_id'))
409 410
          var status_ok = _.contains(['DOWN', 'ACTIVE', 'CONNECTED'], 
410 411
                                     this.get('status'));
411 412
          var vm_status_ok = this.get('vm') && this.get('vm').can_connect();
......
507 508

  
508 509
      model_actions: {
509 510
        'remove': [['status'], function() {
510
          var status_ok = _.contains(['DISCONNECTED'], this.get('status'))
511
          var status_ok = _.contains(['DISCONNECTED'], this.get('status'));
511 512
          return status_ok
512 513
        }],
513 514
        'connect': [['status'], function() {
......
517 518
        'disconnect': [['status', 'port_id', 'port'], function() {
518 519
          var port = this.get('port');
519 520
          if (!port) { return false }
521

  
522
          // not connected to a device
523
          if (port && !port.get('device_id')) { return true }
520 524
          return port.get('can_disconnect');
521 525
        }]
522 526
      },

Also available in: Unified diff