<commit_before>require 'chef/provisioning/azurerm/azure_provider'
require 'pry'
#require 'pry-nav'
#require 'pry-stack_explorer'


class Chef
  class Provider
    class AzureNetworkInterface < Chef::Provisioning::AzureRM::AzureProvider
      provides :azure_network_interface

      def whyrun_supported?
        true
      end

      action :create do
        network_interface_exists = does_network_interface_exist
        if network_interface_exists
          converge_by("update network interface #{new_resource.name}") do
            # currently, we let ARM manage the idempotence, so crete and update are the same
            new_resource.public_ip_resource.run_action(:create)
            create_or_update_network_interface # are create and update different (and should they be??)
          end
        else
          converge_by("create network interface #{new_resource.name}") do
            new_resource.public_ip_resource.run_action(:create)
            create_or_update_network_interface
          end
        end
      end

      action :destroy do
        converge_by("destroy network interface: #{new_resource.name}") do
          if does_network_interface_exist
            new_resource.public_ip_resource.run_action(:destroy)
            destroy_network_interface<commit_msg>fixed :destroy action for azure_network_interface<commit_after>require 'chef/provisioning/azurerm/azure_provider'
require 'pry'
#require 'pry-nav'
#require 'pry-stack_explorer'


class Chef
  class Provider
    class AzureNetworkInterface < Chef::Provisioning::AzureRM::AzureProvider
      provides :azure_network_interface

      def whyrun_supported?
        true
      end

      action :create do
        network_interface_exists = does_network_interface_exist
        if network_interface_exists
          converge_by("update network interface #{new_resource.name}") do
            # currently, we let ARM manage the idempotence, so crete and update are the same
            new_resource.public_ip_resource.run_action(:create)
            create_or_update_network_interface # are create and update different (and should they be??)
          end
        else
          converge_by("create network interface #{new_resource.name}") do
            new_resource.public_ip_resource.run_action(:create)
            create_or_update_network_interface
          end
        end
      end

      action :destroy do
        converge_by("destroy network interface: #{new_resource.name}") do
          if does_network_interface_exist
            destroy_network_interface
            new_resource.public_ip_resource.run_action(:destroy)
{'fraction_non_alphanumeric': 0.059923664122137406, 'fraction_numerical': 0.0, 'mean_word_length': 2.9652042360060515, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6709996', 'n_tokens_mistral': 695, 'n_tokens_neox': 692, 'n_words': 167}