示例#1
0
    def getBankIdByUrl(self, card_no = None):

        if card_no is None:
            return

        #获取接口请求签名
        params = {'card_no': card_no}
        sign = self.common.getSign(params)
        params['sign'] = sign

        #请求接口
        common = Common(params)
        reponse = common.post_request()
        print(self.common.log_template%('jdy_url:'+common.url+'reponse data', reponse))

        #获取cardbin的配置
        parser_yaml = ParserYaml()
        cardbin_config = parser_yaml.get_cardbin_config()

        bank_id = 0

        if reponse['code'] == 200:
            bank_id = cardbin_config[reponse['data']['bank_code']]

        return bank_id
 def __init__(self):
     re = Common.exe_shell(
         "sas3ircu list|grep -P  'SAS[0-3]{2}08'").splitlines()
     sas_chip = SASChip()
     for i in re:
         sas_chip.id = Common.exe_shell("echo %s|awk '{print$1}'" %
                                        i).strip()
         sas_chip.name = Common.exe_shell("echo %s|awk '{print$2}'" %
                                          i).strip()
         self.sas_chip_list.append(sas_chip)
     disk_str_list = Common.exe_shell("lsscsi|grep %s" %
                                      data_disk_model).splitlines()
     for i in disk_str_list:
         disk_tmp = DiskAttr(i.split()[5])
         self.disk_list.append(disk_tmp)
示例#3
0
    def __init__(self, db_config, file = None):

        Db.__init__(self, db_config)

        self.file = file

        common = Common()
        self.common = common
示例#4
0
	def __init__(self, devicename):
		self.device_name = devicename
		self.smart = Smart(self.device_name)
		smart_str = Common.exe_shell("smartctl -a %s" % self.device_name)
		lsscsi_str = Common.exe_shell("lsscsi|grep -P '%s *$'" % self.device_name)
		self.sn = Common.exe_shell("echo \"%s\"|grep 'Serial Number'|awk '{print$3}'" % smart_str).strip()
		self.model = Common.exe_shell("echo \"%s\"|awk '{print$4}'" % lsscsi_str).strip()
		self.fw = Common.exe_shell("echo \"%s\"|awk '{print$5}'" % lsscsi_str).strip()
		self.interface = Common.exe_shell("echo \"%s\"|awk '{print$3}'" % lsscsi_str).strip()
示例#5
0
	def __init__(self, device_name=""):
		self.device_name = device_name
		smart_tmp = Common.exe_shell("smartctl -a %s" % device_name)
		search_sata = re.search(r'SATA', smart_tmp, re.M)
		search_nvme = re.search(r'NVM', smart_tmp, re.M)
		search_sas = re.search(r'SAS', smart_tmp, re.M)
		if search_sata:
			self.type = "SATA"
			attr_tmp_list = re.findall(r'.*  0x.*-*', smart_tmp)
			#attr_tmp_list = Common.exe_shell("smartctl -A %s|grep -P '0x'" % self.device_name).splitlines()
			for i in attr_tmp_list:
				tmp = i.strip().split()
				self.attr_list.append(tmp[1].strip())
				self.attr_multi_list.append(tmp[:10])
		if search_nvme:
			self.type = "NVME"
		if search_sas:
			self.type = "SAS"
示例#6
0
    def __init__(self, db_config):

        Db.__init__(self, db_config)

        common = Common()
        self.common = common
示例#7
0
APP_STATIC = os.path.join(BASE_DIR, 'static')
APP_IMAGES = os.path.join(APP_STATIC, 'images')
APP_FONTS = os.path.join(APP_STATIC, 'fonts')


def app_info():
    app = {
        "name": "account",
        "fun": "user",
        "edit_url": 'account:edit_user',
        "del_url": 'account:del_user'
    }
    return app


co = Common()


def signup(request):
    return HttpResponseRedirect(reverse('site_index'))
    # if request.method == 'POST':
    #     co.DD(request.POST)
    #     form = SignupForm(data=request.POST)
    #     print '11'
    #     if form.is_valid():
    #         print '22'
    #         new_user = form.save()
    #         return HttpResponseRedirect(reverse('account:login'))
    # else:
    #     form = SignupForm()
    # return render_to_response('account/signup.html',
示例#8
0
                        metavar='import_loan_user',
                        help="import user info from execl file",
                        nargs=1,
                        required=False)
    parser.add_argument('--file',
                        metavar='filename',
                        help="input the file you want parser",
                        nargs=1,
                        required=False)
    parser.add_argument('--order',
                        metavar="record_ucf_recharge",
                        help="find the new ucf recharge and sign it",
                        nargs=1,
                        required=False)

    args = parser.parse_args()

    #解析ymal配置文件
    parserYmal = ParserYaml()
    db_config = parserYmal.get_jdy_db_config()

    common = Common()
    #导入借款人信息
    if args.user and args.file:
        getattr(LoanUserData(db_config, args.file[0]),
                common.convert(args.user[0]))()

    #先锋充值订单处理
    if args.order:
        getattr(RecordUcfRecharge(db_config), common.convert(args.order[0]))()
示例#9
0
def storage_install_packages():
	return Common.install_rpm(os.path.join(DIR, "storage", "packages", "*.rpm"))