6a3988c73af1b0fc8c9a880eb26f8606ebd32ad2,perfkitbenchmarker/rackspace/rackspace_virtual_machine.py,RackspaceVirtualMachine,_Create,#RackspaceVirtualMachine#,115

Before Change


        with tempfile.NamedTemporaryFile(dir=vm_util.GetTempDir(),
                                         prefix="user-data") as tf:
            u = self.user_name
            script = ["//cloud-config\n",
                      "\n",
                      "runcmd:\n",
                      "\n",
                      "- useradd -s /bin/bash -U -G sudo %s\n" % u,
                      "- chown -R %s:%s /home/%s/\n" % (u, u, u),
                      "- chown %s:%s /home/%s/.ssh/authorized_keys\n" % (u,
                                                                         u,
                                                                         u),
                      "- chmod 600 /home/%s/.ssh/authorized_keys\n" % u,
                      "- awk \"/(ALL:ALL)/{c++;if(c==2){sub("(ALL:ALL)","
                      ""NOPASSWD:");c=0}}1\" /etc/sudoers > t\n",
                      "- cp t /etc/sudoers\n",
                      "- sed -i \"s/(NOPASSWD:)/NOPASSWD:/\" /etc/sudoers\n"]
            tf.write("".join(script))
            tf.flush()
            super(RackspaceVirtualMachine, self)._Create()
            create_cmd = [FLAGS.nova_path]

After Change


    with tempfile.NamedTemporaryFile(dir=vm_util.GetTempDir(),
                                     prefix="user-data") as tf:
      with open(self.ssh_public_key) as f:
        public_key = f.read().rstrip("\n")

      script = CLOUD_CONFIG_TEMPLATE.format(self.user_name, public_key)
      tf.write(script)
      tf.flush()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 6a3988c73af1b0fc8c9a880eb26f8606ebd32ad2
Time: 2015-07-01
Author: carlos.torres@rackspace.com
File Name: perfkitbenchmarker/rackspace/rackspace_virtual_machine.py
Class Name: RackspaceVirtualMachine
Method Name: _Create


Project Name: mynlp/ccg2lambda
Commit Name: 66a06524eba0b22d14204baeb2ca6d4c9db7d1d0
Time: 2017-05-12
Author: pascual@nii.ac.jp
File Name: scripts/semantic_types.py
Class Name:
Method Name: convert_coq_to_nltk_type


Project Name: trevorstephens/gplearn
Commit Name: e562a9e73a4c41dacf93dedb8bfc8e042132c658
Time: 2015-04-12
Author: trev.stephens@gmail.com
File Name: gplearn/tests/test_genetic.py
Class Name:
Method Name: test_verbose_output


Project Name: deepchem/deepchem
Commit Name: 8a49ad8d672e3298c2a64384fb7268a8da7152c7
Time: 2017-12-06
Author: jth82@drexel.edu
File Name: deepchem/molnet/load_function/pcba_datasets.py
Class Name:
Method Name: load_pcba