patch

How to patch a ConfigMap in Kubernetes

南楼画角 提交于 2019-12-04 04:13:53
Kubernetes ships with a ConfigMap called coredns that lets you specify DNS settings. I want to modify or patch a small piece of this configuration by adding: apiVersion: v1 kind: ConfigMap data: upstreamNameservers: | ["1.1.1.1", "1.0.0.1"] I know I can use kubectrl edit to edit the coredns ConfigMap is there some way I can take the above file containing only the settings I want to insert or update and have it merged on top of or patched over the existing ConfigMap ? The reason for this is that I want my deployment to be repeatable using CI/CD. So, even if I ran my Helm chart on a brand new

Mocking a class method and changing some object attributes in Python

元气小坏坏 提交于 2019-12-04 02:50:10
I am new to mock in Python. I want to know how to replace (mock) a class method while testing with another one, knowing that the original just changes some attributes of self without returning any value. For example: def some_method(self): self.x = 4 self.y = 6 So here I can't just change the return_value of the mock. I tried to define a new function (that should replace the original) and give it as side_effect to the mock. But how can I make the mocking function change attributes of the object in the class. Here is my code: @patch('path.myClass.some_method') def test_this(self,someMethod):

Chmod 640 for uploaded file after SUPEE 7405 patch

不想你离开。 提交于 2019-12-04 02:49:00
After installing the SUPEE 7405 patch, we noticed a problem uploading images from the admin. All file permissions are being set to CHMOD 640 which makes them inaccessible to all users. Is there a solution that does not involve rewriting the /lib/Varien/File/Uploader.php file? A new version of SUPEE-7405 has been released that resolves this issue: http://magento.com/security/patches/supee-7405 Updated February 23, 2016 Updated versions of this release are now available. The updates add support for PHP 5.3 and address issues with upload file permissions, merging carts, and SOAP APIs experienced

How do I make a PATCH request in Python?

和自甴很熟 提交于 2019-12-04 02:46:56
问题 Is there a way to make a request using the PATCH HTTP method in Python? I tried using httplib, but it doesn't accept PATCH as method param. 回答1: With Requests, making PATCH requests is very simple: import requests r = requests.patch('http://httpbin.org/patch') 回答2: Seems to work in 2.7.1 as well. >>> import urllib2 >>> request = urllib2.Request('http://google.com') >>> request.get_method = lambda: 'PATCH' >>> resp = urllib2.urlopen(request) Traceback (most recent call last): ... urllib2

how to apply a git patch as if the author committed to my repo?

谁说我不能喝 提交于 2019-12-04 01:58:28
Lets suppose there is a central repository where commits from satellite ones are pushed some time. Developer A makes some commits on his repo while B makes some on his own too. Now, A wants to incorporate one of B's commits into his repo (which he cannot access directly to pull). One way is to have B create a patch and send it to A but in that case there are two problems: 1. The patch will appear as local modifications to A who have then to commit it (with its own name) 2. Once the central repo is updated the changes will conflict (being pushed by two different authors). Is there a way to have

git-apply fails mysteriously, how do I troubleshoot/fix?

我们两清 提交于 2019-12-03 23:29:28
I'm currently trying to to code-style checking on the PRs of a (github) repository, and I want to deliver patches to the submitters with which they can easily fix the codestyle. To this end, I'm pulling down their PR, run our uncrustify script over it to fix any style errors, and want to create a .patch file they can easily apply. However, it consistently breaks on some files. I do (git version 1.7.10.4 with core.autocrlf=input , core.filemode=false ): $ git checkout pr-branch $ git log -1 (shows: commit dbb8d3f) $ git status (nothing to commit, working directory clean) $ <run the code styler

Auto Patcher (Efficient Auto Updater)

孤街浪徒 提交于 2019-12-03 17:39:47
问题 I want an auto updater that detect modified files (by comparing files on the client-side and a server) and only download modified files. I also want it to give me its status lively (To show it on a process bar or something) The scenario is that there's about one thousand clients in a network, that use same application. If a new version of the application is available, they all have to get the new version. But, the bandwidth is limited, so it's not very efficient to give them a full installer

patching using purely WIX

◇◆丶佛笑我妖孽 提交于 2019-12-03 16:33:48
I am struggling with creating a patch purely using WIX and I was hoping if someone could guide me in the right direction. I have a few hundred source files and I run heat against them to create a harvest file followed by creating a package using candle and light. I need to change a few configuration files and I create a 2nd package with the changes. Using Torch and pyro I create the .wixmst file and then when trying to create the msp file, pyro complains with the following error. pyro.exe : error PYRO0252 : No valid transforms were provided to attach to the patch. Check to make sure the

What is the best method to gain users and contributors for my own open source projects? [closed]

徘徊边缘 提交于 2019-12-03 13:29:14
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . There are two questions to this: How can I best "spread the word" about my projects to interested users? How can I best "spread the word" to like-minded developers? I know this sounds easy, but it really isn't. I've participated in official mailing list discussions, establishing a

setting color range in matplotlib patchcollection

扶醉桌前 提交于 2019-12-03 13:01:50
问题 I am plotting a PatchCollection in matplotlib with coords and patch color values read in from a file. The problem is that matplotlib seems to automatically scale the color range to the min/max of the data values. How can I manually set the color range? E.g. if my data range is 10-30, but I want to scale this to a color range of 5-50 (e.g. to compare to another plot), how can I do this? My plotting commands look much the same as in the api example code: patch_collection.py colors = 100 * pylab