code: def partition_master(incoming=True, outgoing=True):
      
  
      echo('Partitioning master. Incoming:{} | Outgoing:{}'.format(incoming, outgoing))
  
      network.save_iptables(shakedown.master_ip())
      network.flush_all_rules(shakedown.master_ip())
      network.allow_all_traffic(shakedown.master_ip())
  
      if incoming and outgoing:
          network.run_iptables(shakedown.master_ip(), DISABLE_MASTER_INCOMING)
          network.run_iptables(shakedown.master_ip(), DISABLE_MASTER_OUTGOING)
      elif incoming:
          network.run_iptables(shakedown.master_ip(), DISABLE_MASTER_INCOMING)
      elif outgoing:
          network.run_iptables(shakedown.master_ip(), DISABLE_MASTER_OUTGOING)
      else:
          pass
docs: Partition master's port alone. To keep DC/OS cluster running.
  
      :param incoming: Partition incoming traffic to master process. Default True.
      :param outgoing: Partition outgoing traffic from master process. Default True.