Skip to content

Instantly share code, notes, and snippets.

@acarmisc
acarmisc / esportameli.sh
Created March 15, 2024 17:55
Export each kubernetes context to single file
#!/bin/bash
# create target folder
mkdir -p contexts
# get all contexts name
contexts=$(kubectl config get-contexts -o=name)
# cycle on each context
for context in $contexts; do
def localstoreSettings(self):
db_url = os.environ['OPENSHIFT_MONGODB_DB_URL']
app_name = os.environ['OPENSHIFT_APP_NAME']
data = {'db_url': db_url, 'app_name': app_name}
return data
def amazonSettings(self):
key = os.environ['AMAZON_KEY']
def wiz_launch(self, cr, uid):
view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'hr_shift_wizard', 'act_window_wiz_shift_view')
return {
'name':"Display Name",
'view_mode': 'form',
'views': view_id,
'view_type': 'form',
'view_mode': 'form',
'res_model': 'hr.shift.wizard',
from Products.CMFCore.utils import getToolByName
users = context['users.csv'].data.split('\n')
regtool = getToolByName(context, 'portal_registration')
index = 1
imported_count = 0
for user in users:
tokens = user.split(';')
if len(tokens) == 5:
passwd, id, last, first, email = tokens